QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#124339#5501. Ctrl+C Ctrl+V5sbCompile Error//C++23150b2023-07-14 17:01:512023-07-14 17:01:53

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-14 17:01:53]
  • 评测
  • [2023-07-14 17:01:51]
  • 提交

answer

int t,i,a;std::string s;main(){for(std::cin>>t;t--;std::cout<<a<<'\n',a=0)for(std::cin>>s,i=0;i+3<s.size();i++)s.substr(i,4)=="ania"&&(a++,s[i+3]=0);}

Details

answer.code:1:16: error: ‘string’ in namespace ‘std’ does not name a type
    1 | int t,i,a;std::string s;main(){for(std::cin>>t;t--;std::cout<<a<<'\n',a=0)for(std::cin>>s,i=0;i+3<s.size();i++)s.substr(i,4)=="ania"&&(a++,s[i+3]=0);}
      |                ^~~~~~
answer.code:1:1: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
  +++ |+#include <string>
    1 | int t,i,a;std::string s;main(){for(std::cin>>t;t--;std::cout<<a<<'\n',a=0)for(std::cin>>s,i=0;i+3<s.size();i++)s.substr(i,4)=="ania"&&(a++,s[i+3]=0);}
answer.code:1:25: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
    1 | int t,i,a;std::string s;main(){for(std::cin>>t;t--;std::cout<<a<<'\n',a=0)for(std::cin>>s,i=0;i+3<s.size();i++)s.substr(i,4)=="ania"&&(a++,s[i+3]=0);}
      |                         ^~~~
answer.code: In function ‘int main()’:
answer.code:1:41: error: ‘cin’ is not a member of ‘std’
    1 | int t,i,a;std::string s;main(){for(std::cin>>t;t--;std::cout<<a<<'\n',a=0)for(std::cin>>s,i=0;i+3<s.size();i++)s.substr(i,4)=="ania"&&(a++,s[i+3]=0);}
      |                                         ^~~
answer.code:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
  +++ |+#include <iostream>
    1 | int t,i,a;std::string s;main(){for(std::cin>>t;t--;std::cout<<a<<'\n',a=0)for(std::cin>>s,i=0;i+3<s.size();i++)s.substr(i,4)=="ania"&&(a++,s[i+3]=0);}
answer.code:1:57: error: ‘cout’ is not a member of ‘std’
    1 | int t,i,a;std::string s;main(){for(std::cin>>t;t--;std::cout<<a<<'\n',a=0)for(std::cin>>s,i=0;i+3<s.size();i++)s.substr(i,4)=="ania"&&(a++,s[i+3]=0);}
      |                                                         ^~~~
answer.code:1:57: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
answer.code:1:84: error: ‘cin’ is not a member of ‘std’
    1 | int t,i,a;std::string s;main(){for(std::cin>>t;t--;std::cout<<a<<'\n',a=0)for(std::cin>>s,i=0;i+3<s.size();i++)s.substr(i,4)=="ania"&&(a++,s[i+3]=0);}
      |                                                                                    ^~~
answer.code:1:84: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
answer.code:1:89: error: ‘s’ was not declared in this scope
    1 | int t,i,a;std::string s;main(){for(std::cin>>t;t--;std::cout<<a<<'\n',a=0)for(std::cin>>s,i=0;i+3<s.size();i++)s.substr(i,4)=="ania"&&(a++,s[i+3]=0);}
      |                                                                                         ^