Submission #746177

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7461772023-05-21 16:39:51JoibanglaPermutation (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(a) / sizeof(a[0]);
findpermutations(p,k);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

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