Submission #128403

# Submission time Handle Problem Language Result Execution time Memory
128403 2019-07-10T21:40:05 Z MatesV13 Magnus (COCI18_magnus) C++11
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
string s;
int ok, honi;
int main (){
ios::sync_with_stdio(0);
cin.tie(0);
  cin >> s;
  string kk = "HONI";
  for (int i=0;i<s.size():i++){
    if (s[i]==kk[ok]){ok++;if(ok==4){ok=0;honi++;}}
    cout << honi;
return 0;
}

Compilation message

magnus.cpp:9:2: error: stray '\302' in program
   string kk = "HONI";
  ^
magnus.cpp:9:3: error: stray '\240' in program
   string kk = "HONI";
   ^
magnus.cpp:10:2: error: stray '\302' in program
   for (int i=0;i<s.size():i++){
  ^
magnus.cpp:10:3: error: stray '\240' in program
   for (int i=0;i<s.size():i++){
   ^
magnus.cpp:11:2: error: stray '\302' in program
     if (s[i]==kk[ok]){ok++;if(ok==4){ok=0;honi++;}}
  ^
magnus.cpp:11:3: error: stray '\240' in program
     if (s[i]==kk[ok]){ok++;if(ok==4){ok=0;honi++;}}
   ^
magnus.cpp:11:5: error: stray '\302' in program
     if (s[i]==kk[ok]){ok++;if(ok==4){ok=0;honi++;}}
     ^
magnus.cpp:11:6: error: stray '\240' in program
     if (s[i]==kk[ok]){ok++;if(ok==4){ok=0;honi++;}}
      ^
magnus.cpp:12:2: error: stray '\302' in program
     cout << honi;
  ^
magnus.cpp:12:3: error: stray '\240' in program
     cout << honi;
   ^
magnus.cpp:12:5: error: stray '\302' in program
     cout << honi;
     ^
magnus.cpp:12:6: error: stray '\240' in program
     cout << honi;
      ^
magnus.cpp: In function 'int main()':
magnus.cpp:10:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i=0;i<s.size():i++){
                 ~^~~~~~~~~
magnus.cpp:10:27: error: expected ';' before ':' token
   for (int i=0;i<s.size():i++){
                           ^
magnus.cpp:10:27: error: expected primary-expression before ':' token
magnus.cpp:10:27: error: expected ')' before ':' token
magnus.cpp:10:27: error: expected primary-expression before ':' token
magnus.cpp:14:1: error: expected '}' at end of input
 }
 ^