Read post
格式字符串是不要想了 直接保存字符串输出就行
#include <stdio.h>
char *f[]=
{
"The Fibonacci number for 0 is 0\n",
"The Fibonacci number for 1 is 1\n",
"The Fibonacci number for 2 is 1\n",
"The Fibonacci number for 3 is 2\n",
"The Fibonacci number for 4 is 3\n",
"The Fibonacci number for 5 is 5\n",
"The Fibonacci number for 6 is 8\n",
"The Fibonacci number for 7 is 13\n",
"The Fibonacci number for 8 is 21\n",
"The Fibonacci number for 9 is 34\n",
"The Fibonacci number for 10 is 55\n",
"The Fibonacci number for 11 is 89\n",
"The Fibonacci number for 12 is 144\n",
"The Fibonacci number for 13 is 233\n",
"The Fibonacci number for 14 is 377\n",
"The Fibonacci number for 15 is 610\n",
"The Fibonacci number for 16 is 987\n",
"The Fibonacci number for 17 is 1597\n",
"The Fibonacci number for 18 is 2584\n",
"The Fibonacci number for 19 is 4181\n",
"The Fibonacci number for 20 is 6765\n",
"The Fibonacci number for 21 is 10946\n",
"The Fibonacci number for 22 is 17711\n",
"The Fibonacci number for 23 is 28657\n",
"The Fibonacci number for 24 is 46368\n",
"The Fibonacci number for 25 is 75025\n",
"The Fibonacci number for 26 is 121393\n",
"The Fibonacci number for 27 is 196418\n",
"The Fibonacci number for 28 is 317811\n",
"The Fibonacci number for 29 is 514229\n",
"The Fibonacci number for 30 is 832040\n",
"The Fibonacci number for 31 is 1346269\n",
"The Fibonacci number for 32 is 2178309\n",
"The Fibonacci number for 33 is 3524578\n",
"The Fibonacci number for 34 is 5702887\n",
"The Fibonacci number for 35 is 9227465\n",
"The Fibonacci number for 36 is 14930352\n",
"The Fibonacci number for 37 is 24157817\n",
"The Fibonacci number for 38 is 39088169\n",
"The Fibonacci number for 39 is 63245986\n",
"The Fibonacci number for 40 is 102334155\n"
};
int main(void)
{
int n;
while(scanf("%d",&n)!=EOF)
printf(f[n]);
return 0;
}
Reply
|