#196
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 | #52285701 | Utilizator | |
Fișier | aranjamente.cpp | Dimensiune | 670 B |
Data încărcării | 25 Septembrie 2024, 14:31 | Scor / rezultat | Eroare de compilare |
aranjamente.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream fout("aranjamente.out") ^ aranjamente.cpp: In function 'void Afis()': aranjamente.cpp:10:20: error: 'p' was not declared in this scope for(int j=1;j<=p;j++) ^ aranjamente.cpp:11:9: error: 'fout' was not declared in this scope fout<<x[j]<<" "; ^ aranjamente.cpp:11:15: error: 'x' was not declared in this scope fout<<x[j]<<" "; ^ aranjamente.cpp:12:5: error: 'fout' was not declared in this scope fout<<endl; ^ aranjamente.cpp: In function 'bool OK(int)': aranjamente.cpp:18:12: error: 'x' was not declared in this scope if(x[k]==x[i]) ^ aranjamente.cpp: In function 'bool Solutie(int)': aranjamente.cpp:25:15: error: 'p' was not declared in this scope return k==p; ^ aranjamente.cpp: In function 'void back(int)': aranjamente.cpp:30:20: error: 'n' was not declared in this scope for(int i=1;i<=n;i++) ^ aranjamente.cpp:32:9: error: 'x' was not declared in this scope x[k]=i; ^ aranjamente.cpp:33:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(OK(k)) ^ aranjamente.cpp: In function 'int main()': aranjamente.cpp:42:10: error: 'n' was not declared in this scope fin>>n>>p; ^ aranjamente.cpp:42:13: error: 'p' was not declared in this scope fin>>n>>p; ^ aranjamente.cpp: At global scope: aranjamente.cpp:47:1: error: expected declaration before '}' token } ^ aranjamente.cpp: In function 'bool Solutie(int)': aranjamente.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.