摘要: Problem DescriptionFibonacci数列,定义如下:f(1)=f(2)=1f(n)=f(n-1)+f(n-2) n>=3。计算第n项Fibonacci数值。Input输入第一行为一个整数N,接下来N行为整数Pi(1#includeint m=10000;struct bignum{ int s[100]; int l;}f[1001];bignum operator+(bignum a,bignum b){ int i,d=0; if(b.l0;i--) printf("%04d",a.s[i]); printf("\n");} 阅读全文
posted @ 2014-04-08 12:40 段少 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N!InputOne N in one line, process to the end of file.OutputFor each N, output N! in one line.Sample Input123Sample Output126高精度运算#include#includeint m=10000;struct bignum{ int s[20001];//存放结果 int l;//数组的长度}a;bignum... 阅读全文
posted @ 2014-04-08 11:51 段少 阅读(141) 评论(0) 推荐(0) 编辑