Files
python/TangDou/XiTi/1089.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

19 lines
369 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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;
}