#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 | #55028422 | Utilizator | |
Fișier | partitiinumar.cpp | Dimensiune | 509 B |
Data încărcării | 17 Decembrie 2024, 11:45 | Scor / rezultat | Eroare de compilare |
partitiinumar.cpp:3:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin( "partitiinumar.in" ); ^ partitiinumar.cpp:4:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout( "partitiinumar.out" ); ^ partitiinumar.cpp: In function 'void afisare(int)': partitiinumar.cpp:9:5: error: reference to 'cout' is ambiguous cout<<sol[i]<<" "; ^ partitiinumar.cpp:4:10: note: candidates are: <typeprefixerror>cout ofstream cout( "partitiinumar.out" ); ^ In file included from partitiinumar.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ partitiinumar.cpp:10:5: error: reference to 'cout' is ambiguous cout<<"\n"; ^ partitiinumar.cpp:4:10: note: candidates are: <typeprefixerror>cout ofstream cout( "partitiinumar.out" ); ^ In file included from partitiinumar.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ partitiinumar.cpp: In function 'void back(int, int)': partitiinumar.cpp:15:18: error: expected ';' before ']' token for(int i=k-1];i<=n-s;i++) ^ partitiinumar.cpp:15:18: error: expected primary-expression before ']' token partitiinumar.cpp:15:18: error: expected ';' before ']' token partitiinumar.cpp:15:18: error: expected primary-expression before ']' token partitiinumar.cpp:15:18: error: expected ')' before ']' token partitiinumar.cpp:15:18: error: expected primary-expression before ']' token partitiinumar.cpp:15:18: error: expected ';' before ']' token partitiinumar.cpp:15:13: warning: unused variable 'i' [-Wunused-variable] for(int i=k-1];i<=n-s;i++) ^ partitiinumar.cpp:15:20: error: 'i' was not declared in this scope for(int i=k-1];i<=n-s;i++) ^ partitiinumar.cpp:15:30: error: expected ';' before ')' token for(int i=k-1];i<=n-s;i++) ^ partitiinumar.cpp: In function 'int main()': partitiinumar.cpp:25:4: error: reference to 'cin' is ambiguous cin>>n; ^ partitiinumar.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin( "partitiinumar.in" ); ^ In file included from partitiinumar.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream 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ă.