#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 | #60764967 | Utilizator | |
| Fișier | permutari.cpp | Dimensiune | 464 B |
| Data încărcării | 11 Noiembrie 2025, 09:40 | Scor/rezultat | Eroare de compilare |
permutari.cpp:1:1: error: 'ifstream' does not name a type ifstream fin ("permutari.in"); ofstream fout ("permutari.out"); ^ permutari.cpp:1:32: error: 'ofstream' does not name a type ifstream fin ("permutari.in"); ofstream fout ("permutari.out"); ^ permutari.cpp: In function 'void afisare(int)': permutari.cpp:5:12: error: 'l' was not declared in this scope for (int i=l;i<=k; it+) ^ permutari.cpp:5:20: error: 'it' was not declared in this scope for (int i=l;i<=k; it+) ^ permutari.cpp:5:23: error: expected primary-expression before ')' token for (int i=l;i<=k; it+) ^ permutari.cpp:6:5: error: 'cout' was not declared in this scope cout<<st[i]<<" "; ^ permutari.cpp:7:1: error: 'cout' was not declared in this scope cout<<endl;} ^ permutari.cpp:7:7: error: 'endl' was not declared in this scope cout<<endl;} ^ permutari.cpp: In function 'int valid(int)': permutari.cpp:9:12: error: expected ';' before '-' token {for (int i-l:i<k;i++) ^ permutari.cpp:9:14: error: found ':' in nested-name-specifier, expected '::' {for (int i-l:i<k;i++) ^ permutari.cpp:9:13: error: 'l' has not been declared {for (int i-l:i<k;i++) ^ permutari.cpp:10:8: error: 'kl' was not declared in this scope if (st[kl--st[i]) return o; ^ permutari.cpp:10:12: error: expected ']' before 'st' if (st[kl--st[i]) return o; ^ permutari.cpp:10:12: error: expected ')' before 'st' permutari.cpp:10:26: error: 'o' was not declared in this scope if (st[kl--st[i]) return o; ^ permutari.cpp: In function 'void back(int)': permutari.cpp:14:16: error: 'l' was not declared in this scope for (int i=l;i<=n;i++) ^ permutari.cpp:16:8: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if (valid(k)) ^ permutari.cpp:20:1: error: a function-definition is not allowed here before '{' token { ^ permutari.cpp:24:2: 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ă.