09 2022 档案

摘要:#include<stdio.h> main() { int a,b,suma,sumb; scanf("%d %d",&a,&b); suma=0; sumb=0; while(a!=0||b!=0) { if(a==1) { suma=suma+b; } else if(a==2) { sumb 阅读全文

posted @ 2022-09-26 23:11 lachesism 阅读(394) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main() { int n,m,sum=0; scanf("%d",&n); m=n%10; sum=sum+m; printf("%d",m); n=n/10; while(n!=0) { m=n%10; sum=sum+m; printf("+%d",m) 阅读全文

posted @ 2022-09-26 23:10 lachesism 阅读(271) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main() { int x,t,m; scanf("%d",&x); t=0; m=x; while(x!=0) { x=x/10; t++; } x=m; t=t-1; while(t!=0) { x=x/10; t--; } printf("%d",x); 阅读全文

posted @ 2022-09-26 23:09 lachesism 阅读(188) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main() { int t,x; float sum; t=0; sum=0; scanf("%d",&x); if(x 1) { printf("无数据"); } else{ while (x!=-1) { sum+=x; t++; scanf("%d",& 阅读全文

posted @ 2022-09-26 23:08 lachesism 阅读(370) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main() { int t,x; t=0; scanf("%d",&x); while (x!=0) { x=x/10; t++; } printf("%d", t); } 阅读全文

posted @ 2022-09-26 23:08 lachesism 阅读(214) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main() { int t,x; scanf("%d",&x); t=-1; while (x!=-1) { if(x>t) { t=x; } scanf("%d",&x); } printf("%d", t); } 阅读全文

posted @ 2022-09-26 23:07 lachesism 阅读(215) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main() { int m, n, j=0, k=0; scanf("%d %d",&m,&n); j = m; while (j % n != 0) { j = j + m; k = (m * n) / j; } printf("最小公倍数是%d\n最大公约 阅读全文

posted @ 2022-09-26 23:06 lachesism 阅读(21) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> int main() { int year, month, day; int sum = 0, flag = 0; scanf("%d %d %d", &year, &month, &day); switch(month) { case 1: sum = 0; 阅读全文

posted @ 2022-09-26 23:04 lachesism 阅读(117) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main() { int year, month; scanf("%d %d", &year, &month); switch (month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: 阅读全文

posted @ 2022-09-26 23:02 lachesism 阅读(119) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h> int main() { int x,y,z,t; scanf("%d %d %d",&x,&y,&z); if(x<y) { t=x;x=y;y=t; } if(x<z) { t=x;x=z;z=t; } if(y<z) { t=y;y=z;z=t; } pri 阅读全文

posted @ 2022-09-26 22:48 lachesism 阅读(655) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> int main() { int x,y; scanf("%d %d",&x,&y); if(x<y) { printf("%d %d",x,y); } else { printf("%d %d",y,x); } } 阅读全文

posted @ 2022-09-26 22:46 lachesism 阅读(253) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> int main() { char a; scanf("%c",&a); if(a >= 65 && a<= 90) { printf("upper"); } else if(a >= 97 && a <= 122) { printf("lower"); } e 阅读全文

posted @ 2022-09-26 22:45 lachesism 阅读(742) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> int main() { char x; scanf("%c", &x); if (x >= 'a' && x <= 'z') printf("%c", x - 32); else if (x >= 'A' && x <= 'Z') printf("%c", x 阅读全文

posted @ 2022-09-26 22:44 lachesism 阅读(270) 评论(0) 推荐(0) 编辑

摘要:已知A矩阵为: 4 20 12 8 3 15 0 40 8 22 12 36 11 30 18 46 将A中元素大于10且小于25的数找出来,并输出该值在矩阵中的坐标位置 要求输出 11 4 1 20 1 2 15 2 2 22 3 2 12 1 3 12 3 3 18 4 3 A=[4,20,12 阅读全文

posted @ 2022-09-26 22:33 lachesism 阅读(151) 评论(0) 推荐(0) 编辑

摘要:已知A矩阵为: 4 20 12 8 3 15 0 40 8 22 12 36 11 30 18 46 将A中元素能被3整除的,全部置0 要求输出 4 20 0 8 0 0 0 40 8 22 0 0 11 0 0 46 A=[4,20,12,8;3,15,0,40;8,22,12,36;11,30, 阅读全文

posted @ 2022-09-26 22:32 lachesism 阅读(125) 评论(0) 推荐(0) 编辑

摘要:已知A矩阵为: 4 20 12 8 3 15 0 40 8 22 12 36 11 30 18 46 将A中元素小于等于12全部置0 要求输出 0 20 0 0 0 15 0 40 0 22 0 36 0 30 18 46 A=[4,20,12,8;3,15,0,40;8,22,12,36;11,3 阅读全文

posted @ 2022-09-26 22:28 lachesism 阅读(92) 评论(0) 推荐(0) 编辑

摘要:计算矩阵的加减运算 已知矩阵为A为 2 4 3 5 矩阵B为 2 5 6 2 1 3 0 8 计算矩阵: 1. B的左侧2列分别乘以A中对应元素的值;B的右侧2列分别乘以A中对应元素的值 2. A*B 3. B的转置乘以A, 即B'*A 要求输出 4 20 12 8 3 15 0 40 8 22 1 阅读全文

posted @ 2022-09-26 22:27 lachesism 阅读(83) 评论(0) 推荐(0) 编辑

摘要:计算矩阵的加减运算 已知矩阵为A为 2 4 3 5 矩阵B为 2 5 6 2 1 3 0 8 计算矩阵: 1. B的左侧2列分别加上A中对应元素的值;B的右侧2列分别加上A中对应元素的值 2. B的中间两列分别减去A中对应元素的值 要求输出 4 9 8 6 4 8 3 13 3 2 0 -5 a=[ 阅读全文

posted @ 2022-09-26 22:26 lachesism 阅读(102) 评论(0) 推荐(0) 编辑

摘要:已知A为4*5的矩阵 12 3 4 7 8 5 6 9 11 13 2 1 15 20 21 10 6 11 8 9 完成如下操作: 将A(2,4)的11和A(3,2)的删除后,保持数据次序不变的情况下,重新整理成3行6列的矩阵数据。 输出3行6列的矩阵 A=[12,3,4,7,8;5,6,9,11 阅读全文

posted @ 2022-09-26 22:23 lachesism 阅读(106) 评论(0) 推荐(0) 编辑

摘要:已知A为5*4矩阵,请问元素A(2,3)为矩阵中第几个数 第13个数据在矩阵A的第几行第几列 12 3 4 7 8 5 6 9 11 13 2 1 15 20 21 10 6 11 8 9 要求输出2行 第1行为一个整数k,表示指定元素为第几个数 第2行为2个整数m,n,表示第13个数为第m行第n列 阅读全文

posted @ 2022-09-26 22:20 lachesism 阅读(140) 评论(0) 推荐(0) 编辑

摘要:如下4x5的矩阵 12 3 4 7 8 5 6 9 11 13 2 1 15 20 21 10 6 11 8 9 输出第2行到第4行的子矩阵 5 6 9 11 13 2 1 15 20 21 10 6 11 8 9 A=[12,3,4,7,8;5,6,9,11,13;2,1,15,20,21;10, 阅读全文

posted @ 2022-09-26 22:19 lachesism 阅读(105) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int a,b,c; int flag=1; scanf("%d %d %d",&a,&b,&c); if(a+b>c&&a+c>b&&b+c>a) { if(a==b&&b==c) { printf("dengbian\n"); flag= 阅读全文

posted @ 2022-09-19 20:59 lachesism 阅读(902) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int a,d=0; scanf("%d",&a); while(a>86399) { a=a-86400; d++; if(a<86399) { break; } } if(a<43199&&d!=0) { int h; h=a/3600; 阅读全文

posted @ 2022-09-19 20:25 lachesism 阅读(350) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h> #include<stdlib.h> int main(){ int n = 0; scanf("%d", &n); int result = 0; if(n < 0){ n = -n; printf("-"); } while(1) { result = n % 阅读全文

posted @ 2022-09-19 20:09 lachesism 阅读(192) 评论(0) 推荐(0) 编辑

摘要:#include"stdio.h" int main() { int x,y; scanf("%d",&x); y= x<0?-x:x; //构造一个条件表达式,当x<0时,取-x的值,否则取x的值 printf("%d",y); } 阅读全文

posted @ 2022-09-19 19:58 lachesism 阅读(218) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h> main() { int t,sum=0; while(scanf("%d",&t)!=0) { if(t 1) break; sum=sum+t; } printf("%d\n",sum); } 阅读全文

posted @ 2022-09-19 19:47 lachesism 阅读(666) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h> main() { int y; scanf("%d",&y); if((y%400==0) || (y%4==0 && y%100!=0)) { printf("YES"); } else { printf("NO"); } } 阅读全文

posted @ 2022-09-19 19:23 lachesism 阅读(91) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int a,b,s; scanf("%d %d",&a,&b); if(a<=3) { s=10; } else if(a<=10) { s=10+(a-3)*2; } else { s=24+(a-10)*3; } if(b>5) { s= 阅读全文

posted @ 2022-09-19 19:11 lachesism 阅读(342) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int x,y; scanf("%d %d",&x,&y); if(x>0&&y>0) { printf("I"); } else if(x<0&&y>0) { printf("II"); } else if(x<0&&y<0) { prin 阅读全文

posted @ 2022-09-19 19:05 lachesism 阅读(290) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a) { printf("Y"); } else { printf("N"); 阅读全文

posted @ 2022-09-19 18:46 lachesism 阅读(223) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int x; scanf("%d",&x); switch(x/10) { case 10: case 9: printf("优\n");break; case 8: printf("良\n");break; case 7: printf(" 阅读全文

posted @ 2022-09-19 18:39 lachesism 阅读(654) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a==b) { printf("C"); } else if(b==c) { printf("A"); } else { printf("B"); } } 阅读全文

posted @ 2022-09-19 18:31 lachesism 阅读(393) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int a; scanf("%d",&a); int g; g=a%10; int s; s=a/10; if(g>s) { printf("%d%d",g,s); } else { printf("%d",a); } } 阅读全文

posted @ 2022-09-19 18:17 lachesism 阅读(241) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int a,b; scanf("%d %d",&a,&b); if(a%b==0) { printf("B是A的约数"); } else { printf("B不是A的约数"); } } 阅读全文

posted @ 2022-09-19 18:08 lachesism 阅读(306) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int a; scanf("%d",&a); if(a<43199) { int h; h=a/3600; int m; m=(a%3600)/60; int s; s=(a%3600)%60; printf("AM %02d:%02d:%0 阅读全文

posted @ 2022-09-19 18:02 lachesism 阅读(485) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int a; scanf("%d",&a); int h; h=a/3600; if(h>23) { int d; d=h/24; h=h-24; if(h>23) { h=h-24; } int m; m=(a%3600)/60; int 阅读全文

posted @ 2022-09-19 17:56 lachesism 阅读(501) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h>main(){ int a,b; scanf("%d %d",&a,&b); if(a>b) printf("%d\n",a); else printf("%d\n",b);} 阅读全文

posted @ 2022-09-12 00:06 lachesism 阅读(415) 评论(0) 推荐(0) 编辑

摘要:#include"stdio.h" main() { int x; scanf("%d",&x); if( x<0) x=-x; printf("%d",x); } 阅读全文

posted @ 2022-09-08 16:32 lachesism 阅读(208) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> int main(void) { int x,y,z; printf("Enter x:\n"); scanf("%d",&x); if(x%10==0) { y=x; z=x; } else { y=x*2; z=x*3; } printf("y=%d\nz= 阅读全文

posted @ 2022-09-08 16:31 lachesism 阅读(207) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int x; printf("Enter x:\n"); scanf("%d",&x); int r; r=x%10; int y; if(r==0) { y=x*3; } else { y= x; } printf("f(%d)=%d\n" 阅读全文

posted @ 2022-09-08 16:31 lachesism 阅读(150) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int x=0; int r=0; scanf("%d",&x); r=x*x*x+x*x+x+1; printf("%d",r); } 阅读全文

posted @ 2022-09-08 16:30 lachesism 阅读(136) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> int main() { int a; scanf("%d",&a); int g; g=a%10; int w; w=a/10000; int q; q=a/1000%10; int b; b=a/100%10; int s; s=a/10%10; int s 阅读全文

posted @ 2022-09-08 16:29 lachesism 阅读(32) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> int main() { int a; scanf("%d",&a); int b; b=a/100; int bf; bf=b*b; int s; s=a/10%10; int sf; sf=s*s; int g; g=a%10; int gf; gf=g*g 阅读全文

posted @ 2022-09-08 16:28 lachesism 阅读(203) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> int main() { int a; scanf("%d",&a); int s; s=a/10; int g; g=a%10; if(g==0) { printf("%d",s); } else { printf("%d%d",g,s); } } 阅读全文

posted @ 2022-09-08 16:26 lachesism 阅读(333) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> int main() { int x,y,temp; //声明三个整型变量 printf("请输入x,y的值:"); //提示输入数据 scanf("%d,%d",&x,&y); //输入2个整数的值,中间用逗号分隔 printf("交换前:x = %d , y 阅读全文

posted @ 2022-09-08 16:25 lachesism 阅读(304) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int a; scanf("%d",&a); int h; h=a/3600; int m; m=(a%3600)/60; int s; s=(a%3600)%60; printf("%02d:%02d:%02d\n",h,m,s); } 阅读全文

posted @ 2022-09-08 16:25 lachesism 阅读(713) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int g,d,c; scanf("%d %d",&g,&d); c=g-d; printf("%d\n",c); } 阅读全文

posted @ 2022-09-08 16:24 lachesism 阅读(140) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main( ) { int x,y; int r; scanf("%d %d",&x,&y); r=x-y; printf("%d-%d=%d\n",x,y,r); } 阅读全文

posted @ 2022-09-08 16:23 lachesism 阅读(134) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h> int main() { int n; scanf("%d",&n); if(n<0) { n=-n; } printf("%d\n",n); return 0; } 阅读全文

posted @ 2022-09-05 09:59 lachesism 阅读(352) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h> int main() { int n,a,b,c,sum; scanf("%d",&n); a=n/100; b=(n/10)%10; c=n%10; sum=a+b+c; printf("%d",sum); } 阅读全文

posted @ 2022-09-05 09:56 lachesism 阅读(223) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h>main(){ int a,b,c; scanf("%d %d",&a,&b); c=a+b; printf("%d",c);} 阅读全文

posted @ 2022-09-01 23:06 lachesism 阅读(987) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main() { int n,m; scanf("%d%d",&n,&m); printf("%d %d\n",n,m); } 阅读全文

posted @ 2022-09-01 23:05 lachesism 阅读(202) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h>int main(){ int n,a,b,c; scanf("%d",&n); a=n/100; b=(n/10)%10; c=n%10; printf("%d %d %d",c,b,a);} 阅读全文

posted @ 2022-09-01 23:03 lachesism 阅读(2196) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h> main() { printf(" *\n ***\n *****\n *******\n*********\n"); } 阅读全文

posted @ 2022-09-01 22:24 lachesism 阅读(748) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h> main() { int n,m,sum,ca,chen; scanf("%d %d",&n,&m); sum=n+m; ca=n-m; chen=n*m; printf("%d %d %d\n",sum,ca,chen); printf("%d\n%d\n%d" 阅读全文

posted @ 2022-09-01 22:23 lachesism 阅读(146) 评论(0) 推荐(0) 编辑

摘要:#include<stdio.h> main() { int x,b,m; scanf("%d",&x); b=x+28; m=b-2; printf("%d %d",b,m); } 阅读全文

posted @ 2022-09-01 22:22 lachesism 阅读(205) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h>main(){ printf("He said,\"hello, world\""); } 阅读全文

posted @ 2022-09-01 22:20 lachesism 阅读(87) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main() { printf("张三"); printf(" zhangsan@hotmail.com"); } 阅读全文

posted @ 2022-09-01 22:19 lachesism 阅读(143) 评论(0) 推荐(0) 编辑

摘要:#include <stdio.h> main() { printf("李四 lisi@hotmail.com"); } 阅读全文

posted @ 2022-09-01 22:17 lachesism 阅读(186) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示