#319
suma35
Se dă un număr natural nenul n
. Să se determine toate modalităţile distincte de descompunere a numărului n
în sumă de 3
şi 5
.
Problema | suma35 | Operații I/O |
suma35.in /suma35.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #8485729 | Utilizator | |
Fișier | suma35.cpp | Dimensiune | 687 B |
Data încărcării | 25 Februarie 2018, 17:31 | Scor / rezultat | Eroare de compilare |
suma35.cpp:6:1: error: expected ',' or ';' before 'int' int n, st[1001], s; ^ suma35.cpp: In function 'void tip()': suma35.cpp:10:16: error: 'k' was not declared in this scope for(i=1;i<=k;i++) ^ suma35.cpp:11:15: error: 'st' was not declared in this scope fout<<st[i]<<" "; ^ suma35.cpp: In function 'int valid(int)': suma35.cpp:17:5: error: 's1' was not declared in this scope s1=0; ^ suma35.cpp:19:15: error: 'st' was not declared in this scope s1=s1+st[i]; ^ suma35.cpp:21:12: error: 'st' was not declared in this scope if(st[k]<st[i]) return 0; ^ suma35.cpp:22:10: error: 'n' was not declared in this scope if(s1>n) return 0; ^ suma35.cpp: In function 'void Back(int)': suma35.cpp:30:9: error: 'st' was not declared in this scope st[k]=i; ^ suma35.cpp:32:16: error: 's1' was not declared in this scope if(s1==n) ^ suma35.cpp:32:20: error: 'n' was not declared in this scope if(s1==n) ^ suma35.cpp:31:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(valid(k)) ^ suma35.cpp: In function 'int main()': suma35.cpp:40:10: error: 'n' was not declared in this scope fin>>n; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema suma35 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ă.