#320
PartitiiNumar
Se dă un număr natural n
. Determinaţi, în ordine lexicografică, toate modalităţile de a-l scrie pe n
ca sumă de numere naturale.
Problema | PartitiiNumar | Operații I/O |
partitiinumar.in /partitiinumar.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55002216 | Utilizator | |
Fișier | partitiinumar.cpp | Dimensiune | 480 B |
Data încărcării | 16 Decembrie 2024, 08:34 | Scor / rezultat | Eroare de compilare |
partitiinumar.cpp: In function 'void tipar(int)': partitiinumar.cpp:8:9: error: 'cout' was not declared in this scope cout<<x[i] << " "; ^ partitiinumar.cpp:8:9: note: suggested alternative: In file included from partitiinumar.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ partitiinumar.cpp:9:5: error: 'cout' was not declared in this scope cout << endl; ^ partitiinumar.cpp:9:5: note: suggested alternative: In file included from partitiinumar.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ partitiinumar.cpp:9:13: error: 'endl' was not declared in this scope cout << endl; ^ partitiinumar.cpp:9:13: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from partitiinumar.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ partitiinumar.cpp: In function 'void back(int, int)': partitiinumar.cpp:19:21: error: expected ',' before '-' token for(int i=[k-1]; ;i<=n; i++) ^ partitiinumar.cpp:19:21: error: expected identifier before '-' token partitiinumar.cpp: In lambda function: partitiinumar.cpp:19:24: error: expected '{' before ';' token for(int i=[k-1]; ;i<=n; i++) ^ partitiinumar.cpp: In function 'void back(int, int)': partitiinumar.cpp:19:24: error: cannot convert 'back(int, int)::__lambda0' to 'int' in initialization partitiinumar.cpp:19:28: warning: for increment expression has no effect [-Wunused-value] for(int i=[k-1]; ;i<=n; i++) ^ partitiinumar.cpp:19:31: error: expected ')' before ';' token for(int i=[k-1]; ;i<=n; i++) ^ partitiinumar.cpp:19:33: error: 'i' was not declared in this scope for(int i=[k-1]; ;i<=n; i++) ^ partitiinumar.cpp:19:36: error: expected ';' before ')' token for(int i=[k-1]; ;i<=n; i++) ^ partitiinumar.cpp: In function 'int main()': partitiinumar.cpp:30:5: error: 'cin' was not declared in this scope cin>>n; ^ partitiinumar.cpp:30:5: note: suggested alternative: In file included from partitiinumar.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PartitiiNumar 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ă.