Submission #211781

# Submission time Handle Problem Language Result Execution time Memory
211781 2020-03-21T08:58:25 Z casperwang Nadan (COCI18_nadan) C++14
Compilation error
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;
               ^