#255
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 | #29810411 | Utilizator | |
| Fișier | fibonacci.c | Dimensiune | 440 B |
| Data încărcării | 24 Mai 2021, 07:59 | Scor/rezultat | 0 puncte |
fibonacci.c: In function 'main': fibonacci.c:8:4: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=] scanf("%d",n); ^ fibonacci.c:9:4: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=] if(n==1) scanf("%d",1); ^ fibonacci.c:10:4: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=] if(n==2) scanf("%d %d",1,1); ^ fibonacci.c:10:4: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'int' [-Wformat=] fibonacci.c:11:4: 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.c:11:4: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'int' [-Wformat=] fibonacci.c:11:4: warning: format '%d' expects argument of type 'int *', but argument 4 has type 'int' [-Wformat=] fibonacci.c:14:8: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=] scanf("%d %d %d",1,1,2); ^ fibonacci.c:14:8: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'int' [-Wformat=] fibonacci.c:14:8: warning: format '%d' expects argument of type 'int *', but argument 4 has type 'int' [-Wformat=] fibonacci.c:8:9: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d",n); ^ fibonacci.c:9:18: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] if(n==1) scanf("%d",1); ^ fibonacci.c:10:18: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] if(n==2) scanf("%d %d",1,1); ^ fibonacci.c:11:18: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] if(n==3) scanf("%d %d %d",1,1,2); ^ fibonacci.c:14:13: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d %d",1,1,2); ^ fibonacci.c:8:9: 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ă.