HustOJ - 1011

时间:2017-05-04 12:37:15   收藏:0   阅读:288
技术分享
 1 #include<stdio.h>
 2 int main()
 3 {
 4     int a,b,s,t,i,j;
 5     while((scanf("%d",&a)==1))
 6     {
 7         if (a<=12&&a>=1)
 8         {
 9             t=0;
10             for (i=1;i<=a;i++)
11             {
12                 s=1;
13                 for (j=1;j<=i;j++)
14                 {
15                     s=s*j;
16                 }
17                 t=t+s;
18             }
19                 printf("%d\n",t);
20         }
21     }
22 }
1011 最大公约数

 

原文:http://www.cnblogs.com/domen0814/p/6806393.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!