Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
120952 陈骏睿 统计数字字符个数 C++ Compile Error 0 MS 0 KB 454 2025-06-02 12:50:49

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ char m[256]; int a=0; int b=0; cin.getline(m,256) while(m[a]) { if(m[a]>='0'&&m[a]<='9') b++; a++; } cout<<b<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:5: error: expected ';' before 'while'
     while(m[a])
     ^
Main.cc:9:9: warning: unused variable 'a' [-Wunused-variable]
     int a=0;
         ^