修改文件结构。
This commit is contained in:
17
POP/05/Optional03.c
Normal file
17
POP/05/Optional03.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int N = 0, count[3] = {0};
|
||||
// Count[0] stores the number of occerence of 5, [1] counts for 6, [2] counts for 7
|
||||
scanf("%d", &N);
|
||||
while (N > 0) {
|
||||
switch (N % 10) {
|
||||
case 5: count[0]++; break;
|
||||
case 6: count[1]++; break;
|
||||
case 7: count[2]++; break;
|
||||
}
|
||||
N /= 10;
|
||||
}
|
||||
printf("%d %d %d", count[0], count[1], count[2]);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user