发布网友 发布时间:2022-05-04 21:24
共1个回答
热心网友 时间:2022-06-26 00:29
#include<stdio.h>追答#include
void function(int n){
int x=1;
int y=0;
int k = 0;
int s =0;
for(int i=0;i<n;i++)
{
if(i == 0){
printf("%d\n",x);
continue;
}
s = x + y;
printf("%d\n",s);
k = x;
x = x+y;
y = k;
}
}
int main(){
int n;
scanf("%d",&n);
function(n);
return 0;
}