제출 #715037

#제출 시각아이디문제언어결과실행 시간메모리
715037The_Cat_PersonKamenčići (COCI21_kamencici)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> using namespace std; int n; cin >> n; int k; cin >> k; string pebbles; cin >> pebbles; int main() { int a = 5 int b = 0 if (a==k) { cout << "NE" } if (b==k) { cout << "NE" } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp:5:1: error: 'cin' does not name a type
    5 | cin >> n;
      | ^~~
Main.cpp:7:1: error: 'cin' does not name a type
    7 | cin >> k;
      | ^~~
Main.cpp:9:1: error: 'cin' does not name a type
    9 | cin >> pebbles;
      | ^~~
Main.cpp: In function 'int main()':
Main.cpp:14:5: error: expected ',' or ';' before 'int'
   14 |     int b = 0
      |     ^~~
Main.cpp:19:8: error: 'b' was not declared in this scope
   19 |    if (b==k)
      |        ^
Main.cpp:21:19: error: expected ';' before '}' token
   21 |       cout << "NE"
      |                   ^
      |                   ;
   22 |     }
      |     ~              
Main.cpp:13:9: warning: unused variable 'a' [-Wunused-variable]
   13 |     int a = 5
      |         ^