Submission #746182

#TimeUsernameProblemLanguageResultExecution timeMemory
746182JoibanglaPermutation (APIO22_perm)C++17
Compilation error
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; }

Compilation message (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 | {
      | ^