摘要: #include<iostream>using namespace std;int main(){ int a,i; while(~scanf("%d",&a)) { if(a==0) printf("1\n"); else if(a<2009) { int count=1; for(i=1;i<=a;i++) count=count*i%2009; printf("%d\n",count); } else if(a>=2009) printf("0\n"); } return 阅读全文
posted @ 2012-06-20 18:43 欧阳生朵 阅读(215) 评论(0) 推荐(0) 编辑
摘要: import java.util.*;import java.math.*;public class Main{ public static void main(String []args) { Scanner cin=new Scanner(System.in); int i,n; while(cin.hasNext()) { n=cin.nextInt(); BigInteger s1 = BigInteger.valueOf(1); BigInteger s2 = BigInteger.valueOf(1); BigInteger s3... 阅读全文
posted @ 2012-06-20 18:14 欧阳生朵 阅读(275) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<cmath>using namespace std;int fac[21]={0,1,1};const double f=(sqrt(5.0)+1.0)/2.0;int main(){ double bit; int n,i; for(i=3;i<=20;i++) fac[i]=fac[i-1]+fac[i-2];//求前20项 while(cin>>n) { if(n<=20) { cout<<fac[n]<<endl; ... 阅读全文
posted @ 2012-06-20 09:42 欧阳生朵 阅读(257) 评论(0) 推荐(0) 编辑