#125
Permutari2
Se citeşte un număr natural nenul n
, apoi n
numere naturale distincte. Să se afişeze, în ordine lexicografică, permutările mulţimii formate din cele n
numere citite.
Problema | Permutari2 | Operații I/O |
permutari2.in /permutari2.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54104336 | Utilizator | |
Fișier | permutari2.cpp | Dimensiune | 894 B |
Data încărcării | 19 Noiembrie 2024, 20:23 | Scor / rezultat | Eroare de compilare |
permutari2.cpp:1:1: error: 'ifstream' does not name a type ifstream fin ("permutari2.in") ^ permutari2.cpp: In function 'void citire()': permutari2.cpp:7:5: error: 'fin' was not declared in this scope fin>>n; ^ permutari2.cpp:7:10: error: 'n' was not declared in this scope fin>>n; ^ permutari2.cpp:8:19: error: expected initializer before '<=' token for(int i=1, i<=n, i++) ^ permutari2.cpp:8:19: error: expected ';' before '<=' token permutari2.cpp:8:19: error: expected primary-expression before '<=' token permutari2.cpp:8:27: error: expected ';' before ')' token for(int i=1, i<=n, i++) ^ permutari2.cpp:9:1: error: expected primary-expression before '}' token } ^ permutari2.cpp:9:1: error: expected ';' before '}' token permutari2.cpp: In function 'void ordo()': permutari2.cpp:13:19: error: expected initializer before '<=' token for(int i=1, i<=n-1, i++) ^ permutari2.cpp:13:19: error: expected ';' before '<=' token permutari2.cpp:13:19: error: expected primary-expression before '<=' token permutari2.cpp:13:21: error: 'n' was not declared in this scope for(int i=1, i<=n-1, i++) ^ permutari2.cpp:13:29: error: expected ';' before ')' token for(int i=1, i<=n-1, i++) ^ permutari2.cpp:15:25: error: expected initializer before '<=' token for(int j=i+1, j<=n, j++) ^ permutari2.cpp:15:25: error: expected ';' before '<=' token permutari2.cpp:15:25: error: expected primary-expression before '<=' token permutari2.cpp:15:33: error: expected ';' before ')' token for(int j=i+1, j<=n, j++) ^ permutari2.cpp:17:16: error: 'v' was not declared in this scope if(v[i]>v[j]) ^ permutari2.cpp:21:24: error: 'o' was not declared in this scope v[j]=v[o]; ^ permutari2.cpp: In function 'int valid(int)': permutari2.cpp:29:19: error: expected initializer before '<=' token for(int i=1, i<=n, i++) ^ permutari2.cpp:29:19: error: expected ';' before '<=' token permutari2.cpp:29:19: error: expected primary-expression before '<=' token permutari2.cpp:29:21: error: 'n' was not declared in this scope for(int i=1, i<=n, i++) ^ permutari2.cpp:29:27: error: expected ';' before ')' token for(int i=1, i<=n, i++) ^ permutari2.cpp:31:12: error: 'st' was not declared in this scope if(st[k]==st[i]) return o; ^ permutari2.cpp:31:33: error: 'o' was not declared in this scope if(st[k]==st[i]) return o; ^ permutari2.cpp: In function 'void afis()': permutari2.cpp:38:19: error: expected initializer before '<=' token for(int i=1, i<=n, i++) ^ permutari2.cpp:38:19: error: expected ';' before '<=' token permutari2.cpp:38:19: error: expected primary-expression before '<=' token permutari2.cpp:38:21: error: 'n' was not declared in this scope for(int i=1, i<=n, i++) ^ permutari2.cpp:38:27: error: expected ';' before ')' token for(int i=1, i<=n, i++) ^ permutari2.cpp:40:9: error: 'fout' was not declared in this scope fout<<v[st[i]]<<" "; ^ permutari2.cpp:40:15: error: 'v' was not declared in this scope fout<<v[st[i]]<<" "; ^ permutari2.cpp:40:17: error: 'st' was not declared in this scope fout<<v[st[i]]<<" "; ^ permutari2.cpp:42:5: error: 'fout' was not declared in this scope fout<<endl; ^ permutari2.cpp:42:11: error: 'endl' was not declared in this scope fout<<endl; ^ permutari2.cpp: In function 'void bkt(int)': permutari2.cpp:47:19: error: expected initializer before '<=' token for(int i=1, i<=n, i++) ^ permutari2.cpp:47:19: error: expected ';' before '<=' token permutari2.cpp:47:19: error: expected primary-expression before '<=' token permutari2.cpp:47:21: error: 'n' was not declared in this scope for(int i=1, i<=n, i++) ^ permutari2.cpp:47:27: error: expected ';' before ')' token for(int i=1, i<=n, i++) ^ permutari2.cpp:49:9: error: 'st' was not declared in this scope st[k]=i; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Permutari2 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ă.