Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
81793 吴雨轩 31统计单词数 C++ Compile Error 0 MS 0 KB 233 2024-07-12 15:35:00

Tests(0/0):


Code:

# include<iostream> # include<cstdio> using namespase std; int main(){ strig a; getline(cin,a); int =a.length(),c=0; for(int i=0;i<b;i++){ if(a[i]==' '&&a[i+1]!=' '&&[i-1]!=0)c++; } cout<c+1; retur 0; }


Run Info:

Main.cc:3:7: error: expected nested-name-specifier before 'namespase'
 using namespase std;
       ^
Main.cc: In function 'int main()':
Main.cc:5:2: error: 'strig' was not declared in this scope
  strig a;
  ^
Main.cc:6:10: error: 'cin' was not declared in this scope
  getline(cin,a);
          ^
Main.cc:6:10: 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:14: error: 'a' was not declared in this scope
  getline(cin,a);
              ^
Main.cc:7:6: error: expected unqualified-id before '=' token
  int =a.length(),c=0;
      ^
Main.cc:8:16: error: 'b' was not declared in this scope
  for(int i=0;i' and 'int')
Main.cc:9:39: error: 'c' was not declared in this scope
   if(a[i]==' '&&a[i+1]!=' '&&[i-1]!=0)c++; }
                                       ^
Main.cc:10:3: error: 'cout' was not declared in this scope
   cout