답안 #128408

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
128408 2019-07-10T21:44:58 Z MatesV13 Magnus (COCI18_magnus) C++11
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
string s, okk;
int ok, honi;
int main (){
ios::sync_with_stdio(0);
cin.tie(0);
  cin >> s;
  okk = "HONI";
  for (int i=0 ; i<s.size() ; i++){
    if (s[i]==okk[ok]){
      ok++; 
      if(ok==4){
         ok=0;
         honi++;
       }
     }
  }
  cout << honi;
return 0;
}

Compilation message

magnus.cpp:9:2: error: stray '\302' in program
   okk = "HONI";
  ^
magnus.cpp:9:3: error: stray '\240' in program
   okk = "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]==okk[ok]){
  ^
magnus.cpp:11:3: error: stray '\240' in program
     if (s[i]==okk[ok]){
   ^
magnus.cpp:11:5: error: stray '\302' in program
     if (s[i]==okk[ok]){
     ^
magnus.cpp:11:6: error: stray '\240' in program
     if (s[i]==okk[ok]){
      ^
magnus.cpp:19:2: error: stray '\302' in program
   cout << honi;
  ^
magnus.cpp:19:3: error: stray '\240' in program
   cout << honi;
   ^
magnus.cpp: In function 'int main()':
magnus.cpp:10:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i=0 ; i<s.size() ; i++){
                   ~^~~~~~~~~