PRF192_-_SP_2025_-_PE_-_CT_3484.webp
SN1

PRF192_-_SP_2025_-_PE_-_CT_3484.webp

  • Media owner SN1
  • Ngày thêm
Problem 2
Write a program to check whether the elements of an array are divisible by 6.
Input
⚫ The first line contains number of elements in the array, n.
⚫ The second line contains n space-separated integers, a1, a2, .., an.
Constraint
• 0<n<50
Output
a; EZ, for 1≤i≤n
-101000 ai 101000, for 1≤i≤n
[4 Points]
For each given element, print "Yes" if it is divisible by 6, otherwise print "No". Each result should be
separated by a space.
Sample testcase Input
Output
Testcase 1
5
Yes No Yes No Yes
12 15 18 20 24
Testcase 2
4
No No Yes Yes
10-4 24-18
CFUO
Practical Paper
3/4
Chưa có bình luận nào.

Thông tin

Category
PRF192
Thêm bởi
SN1
Ngày thêm
Lượt xem
445
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom