#124
Permutari1
Se citeşte un număr natural nenul n
. Să se afişeze, în ordine invers lexicografică, permutările mulţimii {1,2,..,n}
.
Problema | Permutari1 | Operații I/O |
permutari1.in /permutari1.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54026490 | Utilizator | |
Fișier | permutari1.cpp | Dimensiune | 594 B |
Data încărcării | 18 Noiembrie 2024, 10:46 | Scor / rezultat | Eroare de compilare |
permutari1.cpp:3:1: error: stray '\310' in program using namespace stdș ^ permutari1.cpp:3:1: error: stray '\231' in program permutari1.cpp:5:1: error: expected ';' before 'ifstream' ifstream f ("permutari1.in") ^ permutari1.cpp:5:1: error: 'ifstream' does not name a type permutari1.cpp: In function 'void afisare()': permutari1.cpp:11:10: error: 'i' was not declared in this scope for (i = 1; i <= n; i++) ^ permutari1.cpp:11:22: error: 'n' was not declared in this scope for (i = 1; i <= n; i++) ^ permutari1.cpp:12:5: error: 'g' was not declared in this scope g << x[i] << " "; ^ permutari1.cpp:12:10: error: 'x' was not declared in this scope g << x[i] << " "; ^ permutari1.cpp:13:5: error: 'g' was not declared in this scope g << "/n"; ^ permutari1.cpp: In function 'bool valid(int)': permutari1.cpp:18:9: error: 'i' was not declared in this scope for(i = 1; i < k; i++) ^ permutari1.cpp:19:9: error: 'x' was not declared in this scope if (x[i] == x[k]) return false; ^ permutari1.cpp: In function 'void back(int)': permutari1.cpp:26:10: error: 'i' was not declared in this scope for( i = 1; i <= n; i++) ^ permutari1.cpp:26:22: error: 'n' was not declared in this scope for( i = 1; i <= n; i++) ^ permutari1.cpp:28:9: error: 'x' was not declared in this scope x[k] = i; ^ permutari1.cpp:29:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if ( valid (k)) ^ permutari1.cpp: In function 'int main()': permutari1.cpp:37:5: error: 'f' was not declared in this scope f >> n; ^ permutari1.cpp:37:10: error: 'n' was not declared in this scope f >> n; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Permutari1 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ă.