CS310 Assignment 1
CS310 Assignment 1
Ex1 (easy): Given a positive integer n, find all integer having 4 digits which is
divisible by n.
Example
Input Output
2000 2000 4000 6000 8000
Ex2 (easy): Given an integer n, write a program that generates all the binary
sequences of length n in a lexicographic order.
Example
Input Output
3 000
001
010
011
100
101
110
111
Ex3 (medium): Given a document T and two strings P1, P2 (both having no enter
character and no more 1000 character). Let replace all strings P1 in T by the string
P2.
Input Output
AI Recently, Artificial Intelligence is a key
Artificial Intelligence technology. Artificial Intelligence enable
Recently, AI is a key technology. AI enable efficient operations in many fields.
efficient operations in many fields.
Example: