Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2723 孙浚轩 统计数字字符个数 C++ Wrong Answer 0 MS 268 KB 282 2024-01-20 23:44:37

Tests(1/10):


Code:

#include<iostream> #include<cstring> using namespace std; int main(){ char a[255]; cin.getline(a,100); int lena=strlen(a),i=0,nums=0; while(i<lena){ if(a[i]>='0'&&a[i]<='9') nums++; i++; } cout<<nums; return 0; }


Run Info:

------Input------
Tony is 18 years old. David has 3 dogs. Great changes have taken place in China over the last 20 years. There are 5 people in my family.
------Answer-----
6
------Your output-----
5