Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Project 3 Part 1 v1.7
//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); for(i=0;i<=n;i++){ if(x<0&&i%2==0) f1=f1+f2; printf("%d",f1); continue; else if(x<0&&i%2!=0) f2=f1+f2; printf("%d",f1); continue; else 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
B_141202_CTYPE
1.4 Thread IDs
18BCE2182 ASSESS_1 Q1-4
Programação em C, testes
lab pro v.05
funciones serie de taylor
Leap year check
a3
Static scope
Maximum