You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
369 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
int main() {
string a;
//注意这里是有空格的语句不能直接使用cin!!!
getline(cin, a);
int count = 0;
for (int i = 0; i < a.length(); i++) {
if (a[i] >= '0' && a[i] <= '9') {
count++;
}
}
cout << count << endl;
return 0;
}