mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-12-16 15:44:39 +00:00
22 lines
300 B
C
22 lines
300 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int main() {
|
|
char str[100];
|
|
int count = 0;
|
|
|
|
gets(str);
|
|
|
|
int len = strlen(str);
|
|
|
|
for (int i = 0; i < len; i++) {
|
|
if (str[i] >= '0' && str[i] <= '9') {
|
|
count++;
|
|
}
|
|
}
|
|
|
|
printf("%d\n", count);
|
|
|
|
return 0;
|
|
}
|