Describes a given k (1<k<100) positive integer, where each number is a number greater than or equal to 1, less than or equal to 10. The Write program calculates the number of occurrences of 1,5 and 10 in a given K positive integer. The input input has two lines: The first line contains a positive integer k, the second row contains k positive integers, and each two positive integers are separated by a single space. The output output has three rows, the number of occurrences of the first Act 1, the number of occurrences of the second Act 5, and the number of occurrences of the third Act 10. Sample input
Sample output
121
Introduction to Source Computing 05-Mock Exam 1
#include <stdio.h>intMain () {intN,i,a; intx=0, y=0, z=0; scanf ("%d",&N); for(i=1; i<=n;i++) {scanf ("%d",&a); if(a==1) x++; if(a==5) y++; if(a==Ten) Z++; } printf ("%d\n%d\n%d\n", x, Y, z); return 0;}
1-5-09: Number of integers