Submission #746267

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

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