Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
37099 | chenyifei | 统计数字字符个数 | C++ | Accepted | 0 MS | 240 KB | 289 | 2024-01-19 15:08:28 |
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<string> using namespace std; int main() { char s[256]; int cnt=0; cin.getline(s,256); for(int i=0;i<strlen(s);i++){ if(s[i]>='0'&&s[i]<='9'){ cnt++; } } cout<<cnt; return 0; }