#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 | #15894521 | Utilizator | |
Fișier | aranjamente.cpp | Dimensiune | 664 B |
Data încărcării | 19 Mai 2019, 13:08 | Scor / rezultat | Eroare de compilare |
aranjamente.cpp:7:11: warning: multi-character character constant [-Wmultichar] cout<<'/n'; ^ aranjamente.cpp:33:19: warning: missing terminating " character [enabled by default] ofstream cout("aranjamente.out); ^ aranjamente.cpp:33:5: error: missing terminating " character ofstream cout("aranjamente.out); ^ aranjamente.cpp:4:21: error: two or more data types in declaration of 'tipar' void tipar(int a){ ^ aranjamente.cpp: In function 'int solutie(int)': aranjamente.cpp:10:15: error: 'k' was not declared in this scope return(a==k); ^ aranjamente.cpp: In function 'int valid(int)': aranjamente.cpp:14:8: error: 'x' was not declared in this scope if(x[i]==x[a]; ^ aranjamente.cpp:14:18: error: expected ')' before ';' token if(x[i]==x[a]; ^ aranjamente.cpp: In function 'void back(int)': aranjamente.cpp:19:20: error: 'n' was not declared in this scope for(int i=1;i<=n;i++){ ^ aranjamente.cpp:20:9: error: 'x' was not declared in this scope x[a]=i; ^ aranjamente.cpp:21:18: error: 'k' was not declared in this scope if(valid(k)==1) ^ aranjamente.cpp:23:19: error: 'tipar' was not declared in this scope tipar(); ^ aranjamente.cpp:21:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(valid(k)==1) ^ aranjamente.cpp: At global scope: aranjamente.cpp:30:2: error: expected declaration before '}' token } ^ aranjamente.cpp: In function 'int solutie(int)': aranjamente.cpp:11: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ă.