#255
Fibonacci
Se dă un număr natural n
. Să se afişeze în ordine crescătoare, primii n
termeni ai şirului lui Fibonacci.
Problema | Fibonacci | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #29810397 | Utilizator | |
Fișier | fibonacci.cpp | Dimensiune | 440 B |
Data încărcării | 24 Mai 2021, 07:58 | Scor / rezultat | 0 puncte |
fibonacci.cpp: In function 'int main()': fibonacci.cpp:8:16: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'int' [-Wformat=] scanf("%d",n); ^ fibonacci.cpp:9:25: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'int' [-Wformat=] if(n==1) scanf("%d",1); ^ fibonacci.cpp:10:30: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'int' [-Wformat=] if(n==2) scanf("%d %d",1,1); ^ fibonacci.cpp:10:30: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'int' [-Wformat=] fibonacci.cpp:11:35: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'int' [-Wformat=] if(n==3) scanf("%d %d %d",1,1,2); ^ fibonacci.cpp:11:35: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'int' [-Wformat=] fibonacci.cpp:11:35: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'int' [-Wformat=] fibonacci.cpp:14:30: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'int' [-Wformat=] scanf("%d %d %d",1,1,2); ^ fibonacci.cpp:14:30: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'int' [-Wformat=] fibonacci.cpp:14:30: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'int' [-Wformat=] fibonacci.cpp:8:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d",n); ^ fibonacci.cpp:9:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] if(n==1) scanf("%d",1); ^ fibonacci.cpp:10:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] if(n==2) scanf("%d %d",1,1); ^ fibonacci.cpp:11:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] if(n==3) scanf("%d %d %d",1,1,2); ^ fibonacci.cpp:14:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d %d",1,1,2); ^ fibonacci.cpp:8:17: warning: 'n' is used uninitialized in this function [-Wuninitialized] scanf("%d",n); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Caught fatal signal 11 | 20 | 0 | Exemplu | |
2 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
3 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
4 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
5 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Fibonacci 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ă.