답안 #128414

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
128414 2019-07-10T21:57:48 Z MatesV13 Magnus (COCI18_magnus) C++11
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
string s;
string okk = "HONI";
unsigned int ok=0, honi=0;
  cin >> s;
  for (unsigned 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:12:2: error: stray '\302' in program
   for (unsigned int i=0 ; i<s.size() ; i++){
  ^
magnus.cpp:12:3: error: stray '\240' in program
   for (unsigned int i=0 ; i<s.size() ; i++){
   ^
magnus.cpp:13:2: error: stray '\302' in program
     if (s[i]==okk[ok]){
  ^
magnus.cpp:13:3: error: stray '\240' in program
     if (s[i]==okk[ok]){
   ^
magnus.cpp:13:5: error: stray '\302' in program
     if (s[i]==okk[ok]){
     ^
magnus.cpp:13:6: error: stray '\240' in program
     if (s[i]==okk[ok]){
      ^
magnus.cpp:21:2: error: stray '\302' in program
   cout << honi;
  ^
magnus.cpp:21:3: error: stray '\240' in program
   cout << honi;
   ^