^_^,正好在别的论坛上看到这个问题,小改了一下。。。
#include <stdio.h>
int main(void)
{ int i, num;
long f1, f2;
printf("Enter the number(q to quit):___");
printf("\b\b\b");
while(scanf("%d", &num) == 1)
{
printf("\n");
while(getchar() != '\n');
f1 = 1;
f2 = 1;
for(i=1; i <= num/2; i++)
{
printf("%9d %9d", f1, f2);
f1 += f2;
f2 += f1;
printf((i%2 == 0)? "\n" :" ");
}
if(num %2 != 0)
printf("%9d ",f1);
printf("\n");
printf("Enter the number(q to quit):___");
printf("\b\b\b");
}
return 0;
}