#257
Se dă un număr natural n. Să se descompună în sumă cu număr minim de termeni ai şirului lui Fibonacci.
| Problema | FiboSum | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64160528 | Utilizator | |
| Fișier | fibosum.cpp | Dimensiune | 830 B |
| Data încărcării | 21 Aprilie 2026, 08:45 | Scor/rezultat | Eroare de compilare |
fibosum.cpp: In function ‘int main()’: fibosum.cpp:21:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 21 | int main() | ^~ fibosum.cpp:21:9: note: remove parentheses to default-initialize a variable 21 | int main() | ^~ | -- fibosum.cpp:21:9: note: or replace parentheses with braces to value-initialize a variable fibosum.cpp:22:1: error: a function-definition is not allowed here before ‘{’ token 22 | { | ^ fibosum.cpp:51:2: error: expected ‘}’ at end of input 51 | } | ^ fibosum.cpp:11:5: note: to match this ‘{’ 11 | { | ^ fibosum.cpp:19:5: warning: unused variable ‘nr’ [-Wunused-variable] 19 | int nr = 0, a, b, x, y, z, i, t1, t2; | ^~ fibosum.cpp:19:13: warning: unused variable ‘a’ [-Wunused-variable] 19 | int nr = 0, a, b, x, y, z, i, t1, t2; | ^ fibosum.cpp:19:16: warning: unused variable ‘b’ [-Wunused-variable] 19 | int nr = 0, a, b, x, y, z, i, t1, t2; | ^ fibosum.cpp:19:19: warning: unused variable ‘x’ [-Wunused-variable] 19 | int nr = 0, a, b, x, y, z, i, t1, t2; | ^ fibosum.cpp:19:22: warning: unused variable ‘y’ [-Wunused-variable] 19 | int nr = 0, a, b, x, y, z, i, t1, t2; | ^ fibosum.cpp:19:25: warning: unused variable ‘z’ [-Wunused-variable] 19 | int nr = 0, a, b, x, y, z, i, t1, t2; | ^ fibosum.cpp:19:28: warning: unused variable ‘i’ [-Wunused-variable] 19 | int nr = 0, a, b, x, y, z, i, t1, t2; | ^ fibosum.cpp:19:31: warning: unused variable ‘t1’ [-Wunused-variable] 19 | int nr = 0, a, b, x, y, z, i, t1, t2; | ^~ fibosum.cpp:19:35: warning: unused variable ‘t2’ [-Wunused-variable] 19 | int nr = 0, a, b, x, y, z, i, t1, t2; | ^~ fibosum.cpp:51:2: error: expected ‘}’ at end of input 51 | } | ^ fibosum.cpp:9:1: note: to match this ‘{’ 9 | { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FiboSum 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ă.