Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
88523 田苒彤 统计数字字符个数 C++ Compile Error 0 MS 0 KB 248 2024-08-19 11:33:05

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; char s[1000000]; int sum=0; int main() { cin.getline>>s; int n=strlen(s); for(int i=0;i<=n-1;i++){ if(s[i]>=48&&s[i]<=57){ sum++; } } cout<<sum; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:18: error: invalid operands of types '' and 'char [1000000]' to binary 'operator>>'
     cin.getline>>s;
                  ^