Nothing Special   »   [go: up one dir, main page]

V1 Workshop 4 5 PRF192

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

WORKSHOP 4 &5

Software Requirements
● Codeblocks 17.12 on Windows 7 and above.
Instructions
● Step 1: Students using template PE (Tested on 30/10/2023).
● Step 2: Students read questions and prepare answers in the given template.
● Step 3: Prepare to submit answer:
o For each question (e.g., question 1), please create two sub-folders: run and src.
o Copy *.exe file into run folder, *.c file into src folder.
● Step 4 Create structure folder:
o Student create folder following format: TenHo+chulotViettatMSSV -> Question (1,2,3)-> It
contain 02 subfolder(run, src ) :

o Student Zip 02 folder run +src to name file solution.zip

o Student Zip folder NameMSSV and upload to LMS system.

1
WORKSHOP 4

Question 1:

Your program should allow users to enter an array of 'n' characters where 'n'<20, 'n' is entered by users.

It sorts and displays the array of characters in ascending order. Each element prints on one line

Input Format:

The first line contains n is size of the array.

After first line contains n characters.

Constraints:

n < 20, 'n' is entered by users.

Output Format

Displays the array of characters in ascending order. Each element prints on one line after sorted

Sample 1
Input Output
5 abchs
s
a
c
b
h

Sample 2
Input Output
4 2AKc
A
c
K
2

2
WORKSHOP 5
Question 2:

Your program allows users to enter a string: 's' with a maximum length of 100 characters.
The system sorts the characters in each word in the string ‘s’.
Finally, the system normalizes and prints out string ‘s’
Input Format
The first line contains string s
Constraints
s[max] with max <= 100
Output Format
Print out string ‘s’
Sample 1
Input Output
bcad feds sae abcd defs aes

Sample 2
Input Output
A1sWKh DS43ZX ACB 1AKWhs 34DSXZ ABC

Question 3:

Your program allows users to enter a string and Program to check palindrome string using string
functions
A string is called a palindrome if the reverse of the string is the same as the original one. For
example, “madam”, “racecar”, “12321”
Input Format
The first line contains string s
Constraints
s[max] with max <= 100
Output Format
Yes or No if string s is palindrome

Sample 1
Input Output
racecar Yes

Sample 2
Input Output
12345 No

---------------END-------------------

3
HƯỚNG DẪN NÉN FILE solution.ZIP

1. Chọn 3 file cần nén

2. Click phải chuột -> Add to archive (lưu ý đã cài winrar)

3. Nhập tên file nén là solution.zip, lựa chọn loại file .ZIP và click OK

4
4. Cẩn thận kiểm tra lại tên file nén và kết quả nén file

5. Nén file bài làm

5
6

You might also like