标签:style pre int std problem span 斐波那契数 stdio.h \n
#include<stdio.h> int main() { int n; while(scanf("%d",&n)!=EOF){ int x1,x2,i,x; x1=1; x2=1; if(n==1) printf("1"); if(n==2) printf("1 1"); if(n>2) { printf("%d %d",x1,x2); for(i=3;i<=n;i++) { x=x1+x2; printf(" %d",x); x1=x2; x2=x; }} printf("\n"); } return 0; }
标签:style pre int std problem span 斐波那契数 stdio.h \n
原文地址:https://www.cnblogs.com/chenlong991223/p/9865170.html