Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62610 张江鹏 统计字符数量 C++ Compile Error 0 MS 0 KB 273 2023-12-24 16:58:36

Tests(0/0):


Code:

#include<iostream> using namespice std; int main(){ char c[1001]; cin>>c; int n=strlen(c); int a[128]={0}; for(int i=0;i<n;i++){ a[c[i]]++; } int mx=97; for(int i=97;i<123;i++){ if(a[i]<a[mx]){ mx=i; } } cout<<(char)mx<<" "<<a[mx]; }


Run Info:

Main.cc:2:7: error: expected nested-name-specifier before 'namespice'
 using namespice std;
       ^
Main.cc: In function 'int main()':
Main.cc:5:2: error: 'cin' was not declared in this scope
  cin>>c;
  ^
Main.cc:5:2: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
Main.cc:6:16: error: 'strlen' was not declared in this scope
  int n=strlen(c);
                ^
Main.cc:9:9: warning: array subscript has type 'char' [-Wchar-subscripts]
   a[c[i]]++;
         ^
Main.cc:17:2: error: 'cout' was not declared in this scope
  cout<<(char)mx<<" "<