#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 | #33335400 | Utilizator | |
Fișier | aranjamente.cpp | Dimensiune | 536 B |
Data încărcării | 14 Decembrie 2021, 23:09 | Scor / rezultat | Eroare de compilare |
aranjamente.cpp:4:15: warning: missing terminating " character [enabled by default] ofstream cout("aranjamente.out); ^ aranjamente.cpp:4:1: error: missing terminating " character ofstream cout("aranjamente.out); ^ aranjamente.cpp:5:7: error: 'v' has not been declared int x,v[1001],p[1001],y; ^ aranjamente.cpp:5:15: error: 'p' has not been declared int x,v[1001],p[1001],y; ^ aranjamente.cpp:5:23: error: 'y' has not been declared int x,v[1001],p[1001],y; ^ aranjamente.cpp:5:24: error: expected ')' before ';' token int x,v[1001],p[1001],y; ^ aranjamente.cpp: In function 'void afis()': aranjamente.cpp:8:21: error: 'y' was not declared in this scope for(int i=1;i<=y;i++) ^ aranjamente.cpp:9:19: error: 'v' was not declared in this scope cout << v[i]<< ' '; ^ aranjamente.cpp:10:13: error: invalid operands of types 'std::ofstream(int, int*, int*, int) {aka std::basic_ofstream<char>(int, int*, int*, int)}' and '<unresolved overloaded function type>' to binary 'operator<<' cout <<endl; ^ aranjamente.cpp: In function 'void back(int)': aranjamente.cpp:14:21: error: 'x' was not declared in this scope for(int i=1;i<=x;i++) ^ aranjamente.cpp:15:15: error: 'p' was not declared in this scope if(!p[i]) ^ aranjamente.cpp:18:16: error: 'v' was not declared in this scope v[k]=i; ^ aranjamente.cpp:19:22: error: 'y' was not declared in this scope if(k==y) afis(); ^ aranjamente.cpp: In function 'int main()': aranjamente.cpp:26:11: error: 'x' was not declared in this scope cin>>x>>y; ^ aranjamente.cpp:26:14: error: 'y' was not declared in this scope cin>>x>>y; ^
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ă.