标签:des style http java color os strong 数据
神、上帝以及老天爷
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 21906 Accepted Submission(s): 9213
1 2
50.00%题目很明显就是错排,引用数学公式:a[i]=(i-1)*(a[i-1]+a[i-2],就可以了,注意精度!#include <stdio.h> int main() { int i,t,n; double a[20]; scanf("%d",&t); a[1]=0; a[2]=1; for(i=3;i<=20;i++) {a[i]=(i-1)*(a[i-1]+a[i-2]);} while(t--) { scanf("%d",&n); for(i=1;i<=n;i++) {a[n]/=i;} printf("%.2lf%c\n",a[n]*100,'%'); } return 0; }
houoj2048神、上帝以及老天爷,布布扣,bubuko.com
标签:des style http java color os strong 数据
原文地址:http://blog.csdn.net/hpuhjl/article/details/38147125