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

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; char s[255]; 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 [255]' to binary 'operator>>'
     cin.getline>>s;
                  ^