제출 #746267

#제출 시각아이디문제언어결과실행 시간메모리
746267Joibangla순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include<perm.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:8:2: error: extended character   is not valid in an identifier
    8 |    cout<<p[i]<<"";
      |  ^
perm.cpp: In function 'void display(int*, int)':
perm.cpp:8:2: error: '\U000000a0' was not declared in this scope
    8 |    cout<<p[i]<<"";
      |  ^
perm.cpp:12:1: error: a function-definition is not allowed here before '{' token
   12 | {
      | ^
perm.cpp:26:1: error: a function-definition is not allowed here before '{' token
   26 | {
      | ^
perm.cpp:33:1: error: expected '}' at end of input
   33 | }
      | ^
perm.cpp:6:1: note: to match this '{'
    6 | {
      | ^