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