#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 | #52556599 | Utilizator | |
Fișier | partitiinumar.cpp | Dimensiune | 1.00 KB |
Data încărcării | 03 Octombrie 2024, 09:39 | Scor / rezultat | Eroare de compilare |
partitiinumar.cpp:7:1: error: expected ',' or ';' before 'int' int n,s,x[101]; ^ partitiinumar.cpp: In function 'int valid(int)': partitiinumar.cpp:11:12: error: 'x' was not declared in this scope if(x[k]=x[k-1]) ^ partitiinumar.cpp:13:5: error: 's' was not declared in this scope s=0; ^ partitiinumar.cpp:16:13: error: 'x' was not declared in this scope s=s+x[i]; ^ partitiinumar.cpp:18:10: error: 'n' was not declared in this scope if(s>n) ^ partitiinumar.cpp: In function 'int solutie(int)': partitiinumar.cpp:25:12: error: 's' was not declared in this scope return s==n; ^ partitiinumar.cpp:25:15: error: 'n' was not declared in this scope return s==n; ^ partitiinumar.cpp: In function 'void tipar(int)': partitiinumar.cpp:31:15: error: 'x' was not declared in this scope fout<<x[i]<<" "; ^ partitiinumar.cpp: In function 'void backt(int)': partitiinumar.cpp:38:5: error: 'x' was not declared in this scope x[k]=0; ^ partitiinumar.cpp:41:17: error: 'n' was not declared in this scope if(x[k]<n) ^ partitiinumar.cpp: In function 'int main()': partitiinumar.cpp:63:10: error: 'n' was not declared in this scope fin>>n; ^ partitiinumar.cpp: In function 'int solutie(int)': partitiinumar.cpp:26: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ă.