mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 21:48:48 +00:00
761. 字符串中的数字个数
https://www.acwing.com/problem/content/submission/code_detail/2846021/
This commit is contained in:
parent
3b0f1223cf
commit
42646f7d60
15
AcWing/761/761.cpp
Normal file
15
AcWing/761/761.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
char c;
|
||||
int ans = 0;
|
||||
while (cin >> c) {
|
||||
if ('0' <= c && c <= '9') {
|
||||
ans++;
|
||||
}
|
||||
}
|
||||
cout << ans << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user