asdasdsa
摘要: 1 #include <stdio.h> 2 int main() 3 { 4 int m,n,a,t,b; 5 for(n=1;n<=200;n++) 6 { 7 m=0; 8 t=n; 9 while(t!=0) //求反序数m 10 { 11 m=m*10+t%10; 12 t/=10; 13 阅读全文
posted @ 2020-04-03 12:07 空白永不败北 阅读(1577) 评论(0) 推荐(0)
摘要: 例如: 8 = 3 + 5. 20 = 3 + 17 20 = 7 + 13. 42 = 5 + 37 42= 11 + 31 42= 13 + 29 42= 19 + 23 1 #include <stdio.h> 2 int sushu(int a) //用sushu(a)判断a是否为素数 3 阅读全文
posted @ 2020-04-03 12:02 空白永不败北 阅读(1118) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 int main() 3 { 4 int n,i=2; 5 scanf("%d",&n); 6 printf("%d=",n); 7 8 while(n!=1) 9 { 10 if(n%i==0) 11 { 12 printf("%d",i); 13 n 阅读全文
posted @ 2020-04-03 11:54 空白永不败北 阅读(2154) 评论(0) 推荐(1)
摘要: 1 #include <stdio.h> 2 int main() 3 { 4 int n,i,j; 5 scanf("%d",&n); 6 for(j=1;j<=3*n-2;j++) //第一排 7 printf("*"); 8 printf("\n"); 9 10 for(i=2;i<=n-1; 阅读全文
posted @ 2020-04-02 11:33 空白永不败北 阅读(601) 评论(0) 推荐(0)
摘要: #include<stdio.h> int main(){ int j,k,i; for(j=1;j<=5;j++) { for(i=2;i<=j;i++) printf(" "); for(k=1;k<=6;k++) printf("*"); printf("\n"); } return 0; } 阅读全文
posted @ 2020-03-31 14:19 空白永不败北 阅读(159) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <math.h> int main() { double a; a=pow(2,31); //2的32次幂 printf("%f\n",a); return 0; } 阅读全文
posted @ 2020-03-31 12:11 空白永不败北 阅读(1827) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main() { int m,n,t,r; scanf("%d%d",&m,&n); if(m<n) //大的那个放在m中,小的放在n中 { t=m; m=n; n=t; } t=m*n; //保留m与n的乘积 while(r!=0) //求公约数 { 阅读全文
posted @ 2020-03-31 11:23 空白永不败北 阅读(967) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 int main() 3 { 4 char first,second; 5 printf("请输入第1个字母\n"); 6 scanf("%c",&first); 7 8 switch (first) 9 { 10 case 'm': 11 printf 阅读全文
posted @ 2020-03-22 17:52 空白永不败北 阅读(220) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main() { int a,b,c,t; //定义和输入 scanf("%d%d%d",&a,&b,&c); if(a>b) //好像是冒泡排序的步骤,感觉是,不确定 { t=a; a=b; b=t; } if(b>c) { t=b; b=c; c=t 阅读全文
posted @ 2020-03-22 10:12 空白永不败北 阅读(4842) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main() { if(A) { S1; } else if(B) { S2; } else { S3; } } else所对应的应该是else if中的if。之前这个代码有问题,所以直接用字母表示了语句。你们可以试一下。 阅读全文
posted @ 2020-03-21 11:20 空白永不败北 阅读(355) 评论(0) 推荐(0)