제출 #15241

#제출 시각아이디문제언어결과실행 시간메모리
15241ttgame분배 (kriii3_Q)C++98
컴파일 에러
0 ms0 KiB
#include <iostream> #include <cstring> using namespace std; int main(void) { int N=1; int K=1; int Z=1; cin >> N >> K; Z = (1 << (N - K)); N = (1 << N); K = (1 << K); for (int i = 0; i < K; i++) { for (int j = 0; j < Z; j++) { if (j % 2 == 0) { int n = (j / 2) * 4 + i; printf("%d ", n); } else { int q = ((j + 1) / 2) * 4 - 1 - i; printf("%d ", q); } } printf("\n"); } }

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

Q.cpp: In function ‘int main()’:
Q.cpp:32:20: error: ‘printf’ was not declared in this scope
     printf("%d ", n);
                    ^
Q.cpp:38:20: error: ‘printf’ was not declared in this scope
     printf("%d ", q);
                    ^
Q.cpp:44:14: error: ‘printf’ was not declared in this scope
   printf("\n");
              ^