#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 | #53035667 | Utilizator | |
Fișier | partitiinumar.cpp | Dimensiune | 866 B |
Data încărcării | 16 Octombrie 2024, 09:28 | Scor / rezultat | Eroare de compilare |
partitiinumar.cpp:9:1: error: expected ',' or ';' before 'int' int st[41],n; ^ partitiinumar.cpp: In function 'void afisare(int)': partitiinumar.cpp:13:15: error: 'st' was not declared in this scope fout<<st[i]<<" "; ^ partitiinumar.cpp: In function 'int valid(int)': partitiinumar.cpp:19:12: 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:30:13: error: 'st' was not declared in this scope s=s+st[i]; ^ partitiinumar.cpp:31:15: error: 'n' was not declared in this scope return s==n; ^ partitiinumar.cpp: In function 'void Back(int)': partitiinumar.cpp:35:21: error: 'n' was not declared in this scope for(int i=1; i<=n; i++) ^ partitiinumar.cpp:37:9: error: 'st' was not declared in this scope st[k]=i; ^ partitiinumar.cpp: In function 'int main()': partitiinumar.cpp:52: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:32: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ă.