Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Project 3 Part 1 v1.75
//gcc 5.4.0 #include <stdio.h> #include <stdlib.h> //Start Program //int n //int i //int f [0,1] //READ n //for(i=0;i<=n;i++){ // if(i%2==0) // f1=f1+f2; // printf("%d,",f1) // } //// if(i%2!==0){ // f2=f1+f2; // printf("%d,",f2); // } //} //End Program int main(void) { int n; int i; int f1=0; int f2=1; scanf("%d",&n); if(n>=0){ for(i=0;i<=n;i++){ if(i==0) printf("0,"); else if(i%2==0){ f1=f1+f2; printf("%d,",f1); continue; } else if(i%2!=0){ f2=f1+f2; printf("%d,",f2); continue; } } } if(n<=0){ for(i=0;i>=n;i++){ if(i==0) printf("0,"); else if(i%2==0){ f1=f1+f2; printf("%d,",f1); continue; } else if(i%2!=0){ f2=f1+f2; printf("%d,",f2); continue; } } } }
run
|
edit
|
history
|
help
0
MATRIZ DE CADENAS
Char data type.c
fork
C_141203_CadenasVarias
BSEARCH() WITH STRUCT
thermal_containers
variable number of arguments 3
strend
123
c