답안 #211781

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
211781 2020-03-21T08:58:25 Z casperwang Nadan (COCI18_nadan) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

signed main() {
  cin >> n >> k;
  for (int i = 1; i < k; i++) {
    cout << i << "\n";
    n -= i;
  }
  cout << n << "\n";
}

Compilation message

nadan.cpp: In function 'int main()':
nadan.cpp:5:10: error: 'n' was not declared in this scope
   cin >> n >> k;
          ^
nadan.cpp:5:10: note: suggested alternative: 'yn'
   cin >> n >> k;
          ^
          yn
nadan.cpp:5:15: error: 'k' was not declared in this scope
   cin >> n >> k;
               ^