#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 | #63405112 | Utilizator | |
| Fișier | aranjamente.cpp | Dimensiune | 811 B |
| Data încărcării | 02 Martie 2026, 10:25 | Scor/rezultat | Eroare de compilare |
aranjamente.cpp:2:1: error: 'fstream' does not name a type fstream fin("aranjamente.in") ^ aranjamente.cpp: In function 'void tipar()': aranjamente.cpp:32:9: error: 'cout' was not declared in this scope cout<<st[i]; ^ aranjamente.cpp:32:9: note: suggested alternative: In file included from aranjamente.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ aranjamente.cpp:33:5: error: 'cout' was not declared in this scope cout<<endl; ^ aranjamente.cpp:33:5: note: suggested alternative: In file included from aranjamente.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ aranjamente.cpp:33:11: error: 'endl' was not declared in this scope cout<<endl; ^ aranjamente.cpp:33:11: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from aranjamente.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ aranjamente.cpp: In function 'void bkt()': aranjamente.cpp:41:41: warning: suggest parentheses around assignment used as truth value [-Wparentheses] {do {} while(as=succesor() && !valid()); ^ aranjamente.cpp:47:5: error: 'else' without a previous 'if' else k--; ^ aranjamente.cpp: In function 'int main()': aranjamente.cpp:52:5: error: 'cout' was not declared in this scope cout<<"n="; cin>>n; ^ aranjamente.cpp:52:5: note: suggested alternative: In file included from aranjamente.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ aranjamente.cpp:52:17: error: 'cin' was not declared in this scope cout<<"n="; cin>>n; ^ aranjamente.cpp:52:17: note: suggested alternative: In file included from aranjamente.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ aranjamente.cpp:54:8: warning: statement is a reference, not call, to function 'bkt' [-Waddress] bkt; ^ aranjamente.cpp:54:8: warning: statement has no effect [-Wunused-value]
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ă.