#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 | #53035641 | Utilizator | |
Fișier | partitiinumar.cpp | Dimensiune | 824 B |
Data încărcării | 16 Octombrie 2024, 09:27 | Scor / rezultat | Eroare de compilare |
partitiinumar.cpp:7:1: error: expected ',' or ';' before 'int' int st[21],n; ^ partitiinumar.cpp: In function 'void afisare(int)': partitiinumar.cpp:12:15: error: 'st' was not declared in this scope fout<<st[i]<<" "; ^ partitiinumar.cpp: In function 'int valid(int)': partitiinumar.cpp:19:8: error: 'st' was not declared in this scope if(st[k]<st[k-1]) ^ partitiinumar.cpp:23:13: error: 'st' was not declared in this scope s=s+st[i]; ^ partitiinumar.cpp:24:15: error: 'n' was not declared in this scope return s<=n; ^ partitiinumar.cpp: In function 'int solutie(int)': partitiinumar.cpp:31:13: error: 'st' was not declared in this scope s=s+st[i]; ^ partitiinumar.cpp:32:15: error: 'n' was not declared in this scope return s==n; ^ partitiinumar.cpp: In function 'void Back(int)': partitiinumar.cpp:37:21: error: 'n' was not declared in this scope for(int i=1; i<=n; i++) ^ partitiinumar.cpp:39:9: error: 'st' was not declared in this scope st[k]=i; ^ partitiinumar.cpp: In function 'int main()': partitiinumar.cpp:55:10: error: 'n' was not declared in this scope fin>>n; ^ partitiinumar.cpp: In function 'int valid(int)': partitiinumar.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ partitiinumar.cpp: In function 'int solutie(int)': partitiinumar.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.