Problem 1
[3 Points]
Output
4
Enter a 4-digit positive integer, calculate the sum of all odd digits in the given number.
Input
Users are required to enter a 4-digit positive integer N using the keyboard (STDIN).
Constraint
• N (1000≤ N ≤9999)
Output
Please print out the sum of all odd digits of the positive integer N.
Sample
Sample 1
1234
Sample 2
Input
2468
Problem 2
[4 Points]
Enter a positive integer N and then enter N elements of an array. Find the largest prime number in the array. If there is no prime number, print 0.
Definition
A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.
For example, 2, 3, 5, 7, and 11 are prime numbers.
Input
Zoom
+ 100%
Close