#123
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 | #63402860 | Utilizator | |
| Fișier | permutari.cpp | Dimensiune | 549 B |
| Data încărcării | 02 Martie 2026, 09:00 | Scor/rezultat | Eroare de compilare |
permutari.cpp: In function 'int sol()': permutari.cpp:17:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ permutari.cpp: In function 'int valid()': permutari.cpp:21:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ permutari.cpp: In function 'void tipar()': permutari.cpp:25:5: error: 'cout' was not declared in this scope cout<< ^ permutari.cpp:25:5: note: suggested alternative: In file included from permutari.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ permutari.cpp:26:1: error: expected primary-expression before '}' token } ^ permutari.cpp:26:1: error: expected ';' before '}' token permutari.cpp: In function 'void bkt()': permutari.cpp:29:12: error: 'a' was not declared in this scope int as=a; ^ permutari.cpp:32:29: warning: the address of 'int valid()' will always evaluate as 'true' [-Waddress] do{}while(as=succesor&&!valid) ^ permutari.cpp:32:29: warning: the address of 'int succesor()' will always evaluate as 'true' [-Waddress] permutari.cpp:32:29: warning: suggest parentheses around assignment used as truth value [-Wparentheses] permutari.cpp:33:6: error: expected ';' before '{' token { ^ permutari.cpp:39:6: error: expected primary-expression before '}' token } ^ permutari.cpp:39:6: error: expected ';' before '}' token permutari.cpp:46:1: error: a function-definition is not allowed here before '{' token { ^ permutari.cpp:51:1: error: expected '}' at end of input } ^ permutari.cpp: In function 'int succesor()': permutari.cpp:13:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.