#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 | #54799750 | Utilizator | |
Fișier | partitiinumar.cpp | Dimensiune | 660 B |
Data încărcării | 09 Decembrie 2024, 09:44 | Scor / rezultat | Eroare de compilare |
partitiinumar.cpp:5:14: warning: missing terminating " character [enabled by default] ofstream fout"partitiinumar.out ^ partitiinumar.cpp:5:1: error: missing terminating " character ofstream fout"partitiinumar.out ^ partitiinumar.cpp:6:1: error: expected initializer before 'int' int n, k, x[20], s; ^ partitiinumar.cpp: In function 'void afisare(int)': partitiinumar.cpp:10:9: error: 'fout' was not declared in this scope fout<<x[i]<<" "; ^ partitiinumar.cpp:10:15: error: 'x' was not declared in this scope fout<<x[i]<<" "; ^ partitiinumar.cpp:11:5: error: 'fout' was not declared in this scope fout<<'\n'; ^ partitiinumar.cpp: In function 'int valid(int)': partitiinumar.cpp:15:5: error: 's' was not declared in this scope s=0; ^ partitiinumar.cpp:17:12: error: 'x' was not declared in this scope s+=x[i]; ^ partitiinumar.cpp:18:10: error: 'n' was not declared in this scope if(s>n) ^ partitiinumar.cpp: In function 'void backt(int)': partitiinumar.cpp:25:21: error: 'n' was not declared in this scope for(int i=1; i<=n; i++) ^ partitiinumar.cpp:27:9: error: 'x' was not declared in this scope x[k]=i; ^ partitiinumar.cpp:30:24: error: 's' was not declared in this scope if(k<=n && s==n) ^ partitiinumar.cpp: In function 'int main()': partitiinumar.cpp:38:10: error: 'n' was not declared in this scope fin>>n; ^
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ă.