麻花蘸豆浆
麻花蘸豆浆
全部文章
分类
题解(30)
归档
标签
去牛客网
登录
/
注册
麻花蘸豆浆的博客
全部文章
(共29篇)
阶乘计算
include<stdio.h> main(){int n,i,j,k,sum=0; scanf("%d",&n);for(i=1;i<=n;i++){k=1; for(j=i;j!=0;j--){k*=j;}sum+=k;}printf("%d",sum);}
2020-03-04
0
642
金字塔
include<stdio.h> main(){int n,i,j,k,xinghao;while(scanf("%d",&n)!=EOF){for(i=1;i<=n;i++){for(j=1;j<=n-i;j++){printf(" ");}xinghao=i+i-...
2020-03-03
0
731
数位之和
include<stdio.h> main(){int n,sum=0;scanf("%d",&n);while(n){sum+=n%10;n/=10;}printf("%d",sum);}
2020-03-02
1
815
选村长
include<stdio.h> main(){int n,a=0,b=0,c=0,t=0,Tot=0,tag; char flag='A';while(scanf("%d",&n),n!=-1){switch(n){case 1:a++;Tot++;break; case 2:...
2020-03-02
0
827
约数之和
include<stdio.h> include<stdlib.h> main(){int n,i,sum=0;scanf("%d",&n);for(i=1;i<=n;i++){if(n%i==0){sum+=i;}}printf("%d",sum);syste...
2020-03-02
0
606
3和5和7
include<stdio.h> int main(){int n,i,t;scanf("%d",&n);for(i=1;i<=n;i++){t=i;if(t%3==2&&t%5==3&&t%7==2){printf("%d\n",i);}}...
2020-03-01
0
697
多组输入a+b ||规定数组
include<stdio.h> int main(){int a,b,n;scanf("%d",&n);while(n--){scanf("%d%d",&a,&b); printf("%d\n",a+b);}}
2020-02-10
0
757
更相减损术
include<stdio.h> main(){int a,b;scanf("%d%d",&a,&b); for(;a!=b;) {if(a>b)a-=b; if(a<b)b-=a;}printf("%d",a);}
2020-02-10
1
674
魔法数字变换
include<stdio.h> main() {int n,m; scanf("%d",&n); for(m=0;n!=1;m++) {if(n%2==0)n/=2; else n=3*n+1;} printf("%d",m);}
2020-02-10
1
772
幸运数字7
include<stdio.h> main(){int n,m,sum=0,tag;scanf("%d",&n);for(m=1;m<=n;m++){if(m%7==0){sum+=m;}} printf("%d",sum);}
2020-02-10
0
745
首页
上一页
1
2
3
下一页
末页