Submission #143292

#TimeUsernameProblemLanguageResultExecution timeMemory
143292grobarMagnus (COCI18_magnus)C++14
50 / 50
10 ms760 KiB
#include <iostream> using namespace std; int main() { string s; cin>>s; int pozicija=0; int k=0; for(int i=0;i<s.size();i++) { if(s[i]=='H' && pozicija==0) { pozicija++; } if(s[i]=='O' && pozicija==1) { pozicija++; } if(s[i]=='N' && pozicija==2) { pozicija++; } if(s[i]=='I' && pozicija==3) { pozicija++; } if(pozicija==4) { k++; pozicija=0; } } cout<<k<<endl; }

Compilation message (stderr)

magnus.cpp: In function 'int main()':
magnus.cpp:11:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<s.size();i++)
                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...