Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Q 1 (1 point) : input a string n characters;

return numbers of character is prime number

Ex: input: 6a2b 3c 3d 5e 7f 379


OUTPUT:
7
Q 2 (0.5 point). input a string n characters
return numbers of character is even number
Ex: input: 1a2b 3c4d 5e6f
OUTPUT:
3
Q 3 (0.5 point). input a string n characters;
return numbers of character is %3==0 at even position.
Ex: input: 2a3b 3c d2 5e 7f37
OUTPUT:
2
Q 4 (1 point) input a string n characters
return the 2nd shortest word. A word is defined by a space. If the string hasn’t second
shortest word write “null”
Ex: input: abc abcdef 123456 abcd
OUTPUT:
null
Q 5 (1 point): input a string n characters;
return the first most frequent word. A word is defined by a space.
Ex: input: edf abc 123 abc 123 edf 123 abc deg
OUTPUT:
Abc

Q 6 (1 point): input a string array with n words n>=6


sort first 3 elements in array by ascending and last 3 elements by
descending follow by alphabet.
Ex: input: chung toi luon co gang lam toi cuoi
OUTPUT:
chung luon toi co gang toi lam cuoi
Q 7 (1 point): input a string n characters;
return a string that replacing each longest word by “Fall” . A word is defined by
a space.
Ex: input: abcdef day by bgh 123456
OUTPUT:
Fall day by bgh Fal
Q8 (1 point): input a string n characters;
return a String by take all the palindrom word in input string . A word is defined
by a space.
Ex: input: 1221 abba bcd bcb 123 veg
OUTPUT:
1221 abba bcb
Q9 (1 point): input a string n characters;
return Reverse order of all words in input string. A word is defined by a space.
Ex: input: abc 123 deg veg 456 end start
OUTPUT:
start end 456 veg deg 123 abc
Q10 (1 point): input a string n characters;
return upper case all the first character and lower case all other characters
of each words in input string. A word is defined by a space.
Ex: input: dai hoc FPT ha noi

OUTPUT:
Dai Hoc Fpt Ha Noi
Q 11. (1 point)
input an integer array with n elements
Input a integer number x. Find x in the array above, if found, insert x after the found position.
if is not found then insert x at the end.
Ex: input: 6 4 6 9 2 5 7 2 // the first number is the number of elements of the array. the last number is
the number x
OUTPUT:
4692257
The program needs to be written with a clear, coherent structure, correct results, and full comments.
- after done, need to compress the code file into a compressed file in which there are .c files named
after the structure,
CodeSV_Q1 for sentence 1, CodeSV_Q2 for question 2
for example HE172592_Q1.c
HE172592_Q2.c

nhớ đổi tên thư mục và tên file thành mã sv của mình

You might also like