#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 | #54345996 | Utilizator | |
Fișier | partitiinumar.cpp | Dimensiune | 571 B |
Data încărcării | 26 Noiembrie 2024, 11:20 | Scor / rezultat | Eroare de compilare |
partitiinumar.cpp:14:13: warning: missing terminating " character [enabled by default] fout << " ^ partitiinumar.cpp:14:5: error: missing terminating " character fout << " ^ partitiinumar.cpp:15:1: warning: missing terminating " character [enabled by default] "; ^ partitiinumar.cpp:15:1: error: missing terminating " character partitiinumar.cpp:6:5: error: expected initializer before 'int' int x[1000], n; ^ partitiinumar.cpp:8:13: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin("partitiinumar.in"); ^ partitiinumar.cpp:9:14: error: variable 'std::ofstream fout' has initializer but incomplete type ofstream fout("partitiinumar.out"); ^ partitiinumar.cpp: In function 'void afisare(int)': partitiinumar.cpp:13:17: error: 'x' was not declared in this scope fout << x[i] << " "; ^ partitiinumar.cpp:16:1: error: expected primary-expression before '}' token } ^ partitiinumar.cpp:16:1: error: expected ';' before '}' token partitiinumar.cpp: In function 'void back(int, int)': partitiinumar.cpp:19:15: error: 'x' was not declared in this scope for(int i=x[k-1] ; i<=n-s ; ++i) ^ partitiinumar.cpp:19:27: error: 'n' was not declared in this scope for(int i=x[k-1] ; i<=n-s ; ++i) ^ partitiinumar.cpp:22:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(s+x[k]<=n) ^ partitiinumar.cpp: In function 'int main()': partitiinumar.cpp:31:10: error: 'n' was not declared in this scope fin>>n; ^ partitiinumar.cpp:32:5: error: 'x' was not declared in this scope x[0]=1; ^
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ă.