#196
Aranjamente
Se citesc două numere naturale nenule n
și k
. Să se afişeze, în ordine lexicografică, aranjamentele de câte k
elemente ale mulţimii {1,2,..,n}
.
Problema | Aranjamente | Operații I/O |
aranjamente.in /aranjamente.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #20769728 | Utilizator | |
Fișier | aranjamente.cpp | Dimensiune | 696 B |
Data încărcării | 10 Februarie 2020, 11:43 | Scor / rezultat | Eroare de compilare |
aranjamente.cpp:7:1: error: expected ',' or ';' before 'ofstream' ofstream fout("aranjamente.out") ^ aranjamente.cpp: In function 'void scriesol()': aranjamente.cpp:13:16: error: 'k' was not declared in this scope for(i=1;i<=k;i++) ^ aranjamente.cpp:14:8: error: 'fout' was not declared in this scope fout<<v[i]<<" "; ^ aranjamente.cpp:14:14: error: 'v' was not declared in this scope fout<<v[i]<<" "; ^ aranjamente.cpp:15:5: error: 'fout' was not declared in this scope fout<<endl; ^ aranjamente.cpp: In function 'int ok(int)': aranjamente.cpp:22:12: error: 'v' was not declared in this scope if(v[i]==v[k]) ^ aranjamente.cpp:22:20: error: 'k' was not declared in this scope if(v[i]==v[k]) ^ aranjamente.cpp: In function 'void back(int)': aranjamente.cpp:30:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ aranjamente.cpp:32:13: error: 'v' was not declared in this scope v[x]=1; ^ aranjamente.cpp:34:23: error: 'k' was not declared in this scope if(x==k) ^ aranjamente.cpp:36:17: error: expected ';' before 'else' else ^ aranjamente.cpp: In function 'int main()': aranjamente.cpp:44:10: error: 'n' was not declared in this scope fin>>n>>k; ^ aranjamente.cpp:44:13: error: 'k' was not declared in this scope fin>>n>>k; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Aranjamente 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ă.