#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 | #54849460 | Utilizator | |
Fișier | permutari.cpp | Dimensiune | 647 B |
Data încărcării | 10 Decembrie 2024, 11:46 | Scor / rezultat | Eroare de compilare |
permutari.cpp:3:12: error: variable 'std::ifstream in' has initializer but incomplete type ifstream in("permutari.in") ^ permutari.cpp:4:1: error: expected ',' or ';' before 'ofstream' ofstream out("permutari.out") ^ permutari.cpp: In function 'void back(int)': permutari.cpp:8:21: error: 'n' was not declared in this scope for(int i=1; i<=n; i++;) ^ permutari.cpp:8:27: error: expected ')' before ';' token for(int i=1; i<=n; i++;) ^ permutari.cpp:8:28: error: expected primary-expression before ')' token for(int i=1; i<=n; i++;) ^ permutari.cpp:8:28: error: expected ';' before ')' token permutari.cpp: In function 'int valid(int)': permutari.cpp:22:12: error: 'sol' was not declared in this scope if(sol[i]==sol[k]) ^ permutari.cpp: In function 'int solutie(int)': permutari.cpp:27:7: error: expected identifier before '(' token return(k==n); ^ permutari.cpp:27:1: error: named return values are no longer supported return(k==n); ^ permutari.cpp:31:21: error: 'n' was not declared in this scope for(int i=1; i<=n; i++) ^ permutari.cpp:32:9: error: 'out' was not declared in this scope out<<sol [i]<<" "; ^ permutari.cpp:32:14: error: 'sol' was not declared in this scope out<<sol [i]<<" "; ^ permutari.cpp:33:5: error: 'out' was not declared in this scope out<<endl; ^ permutari.cpp:34:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ permutari.cpp: In function 'int main()': permutari.cpp:38:9: error: 'n' was not declared in this scope in>>n; ^
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ă.