#123
Permutari
Se citeşte un număr natural nenul n
. Să se afişeze, în ordine lexicografică, permutările mulţimii {1,2,..,n}
.
Problema | Permutari | Operații I/O |
permutari.in /permutari.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #47965608 | Utilizator | |
Fișier | permutari.cpp | Dimensiune | 495 B |
Data încărcării | 11 Ianuarie 2024, 13:07 | Scor / rezultat | Eroare de compilare |
permutari.cpp:3:1: error: stray '\342' in program ifstream fin (“permutari.in”); ^ permutari.cpp:3:1: error: stray '\200' in program permutari.cpp:3:1: error: stray '\234' in program permutari.cpp:3:1: error: stray '\342' in program permutari.cpp:3:1: error: stray '\200' in program permutari.cpp:3:1: error: stray '\235' in program permutari.cpp:4:1: error: stray '\342' in program ofstream fout (“permutari.out”); ^ permutari.cpp:4:1: error: stray '\200' in program permutari.cpp:4:1: error: stray '\234' in program permutari.cpp:4:1: error: stray '\342' in program permutari.cpp:4:1: error: stray '\200' in program permutari.cpp:4:1: error: stray '\235' in program permutari.cpp:9:5: error: stray '\342' in program fout<<st[i]<<” “; fout<<endl;}int verif(int k) ^ permutari.cpp:9:5: error: stray '\200' in program permutari.cpp:9:5: error: stray '\235' in program permutari.cpp:9:5: error: stray '\342' in program permutari.cpp:9:5: error: stray '\200' in program permutari.cpp:9:5: error: stray '\234' in program permutari.cpp:3:18: error: 'permutari' was not declared in this scope ifstream fin (“permutari.in”); ^ permutari.cpp:4:19: error: 'permutari' was not declared in this scope ofstream fout (“permutari.out”); ^ permutari.cpp: In function 'void afisare()': permutari.cpp:9:11: error: 'st' was not declared in this scope fout<<st[i]<<” “; fout<<endl;}int verif(int k) ^ permutari.cpp:9:25: error: expected primary-expression before ';' token fout<<st[i]<<” “; fout<<endl;}int verif(int k) ^ permutari.cpp: In function 'int verif(int)': permutari.cpp:10:30: error: 'st' was not declared in this scope { int i; for(i=1;i<k;i++) if(st[k]==st[i]) return 0; return 1; ^ permutari.cpp: In function 'void BK(int)': permutari.cpp:14:30: error: 'st' was not declared in this scope { int j; for(j=1;j<=n;j++) { st[k]=j; if(verif(k)==1) if(sol(k)==1) afisare(); else BK(k+1); }int main() ^ permutari.cpp:14:41: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] { int j; for(j=1;j<=n;j++) { st[k]=j; if(verif(k)==1) if(sol(k)==1) afisare(); else BK(k+1); }int main() ^ permutari.cpp:15:1: error: a function-definition is not allowed here before '{' token { fin>>n; BK(1); return 0; ^ permutari.cpp:16:1: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Permutari face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.