제출 #746182

#제출 시각아이디문제언어결과실행 시간메모리
746182Joibangla순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; void display(int p[],int k) { for(int i=0; i<k; i++){ cout<<p[i]; } cout<<endl; void findPermutations(int p[],int k) { sort(p,p+k); cout<<"Possible permutations are:\n"; do{ display(p,k); } while(next_permutation(p,p+k)); } int main() { int i=sizeof(p) / sizeof(p[0]); findpermutations(p,k); return 0; }

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

perm.cpp: In function 'void display(int*, int)':
perm.cpp:13:1: error: a function-definition is not allowed here before '{' token
   13 | {
      | ^
perm.cpp:27:1: error: a function-definition is not allowed here before '{' token
   27 | {
      | ^
perm.cpp:34:1: error: expected '}' at end of input
   34 | }
      | ^
perm.cpp:7:1: note: to match this '{'
    7 | {
      | ^