Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
88525 | 田苒彤 | 统计数字字符个数 | C++ | Accepted | 1 MS | 268 KB | 248 | 2024-08-19 11:34:08 |
#include<bits/stdc++.h> using namespace std; char s[255]; int sum=0; int main() { cin.getline(s,255); int n=strlen(s); for(int i=0;i<=n-1;i++){ if(s[i]>=48&&s[i]<=57){ sum++; } } cout<<sum; return 0; }