摘要: /* 输入三个整数,找出期中的中间数(这里的中间数指的是大小不是位置)*/ #include<stdio.h> main() { int a,b, c,max,min,mid; scanf("%d %d %d",&a,&b,&c); if(a>b) {max=a;【1】; } else {max=b 阅读全文
posted @ 2023-02-07 22:32 myrj 阅读(81) 评论(0) 推荐(0) 编辑
摘要: /*输入年号和月份,判断该年是否为闰年,并根据给出的月份判断是什么季节和该月有多少天? 闰年的条件是年号能被4整除但不能被100 整除或者能被400整除 3月-5月为春季,6月-8月为夏季 9月-11月为秋季 12月-2月为冬季*/ #include<stdio.h> main() { int y, 阅读全文
posted @ 2023-02-07 22:22 myrj 阅读(97) 评论(0) 推荐(0) 编辑
摘要: /*输出任意一个十进制数对应的八进制数和十六进制数*/ #include<stdio.h> main() { 【1】; printf("请输入一个整数:"); scanf("%d",【2】); printf("%d(10)<=>【3】(8)\n",i,i); printf("%d(10)<=>%x( 阅读全文
posted @ 2023-02-07 22:11 myrj 阅读(43) 评论(0) 推荐(0) 编辑
摘要: /*编程判断输入的整数的正负性和奇偶性。如果为正数,输出 z,如果为负数,输出 f, 如果为偶数,输出 o,如果为奇数,输出 j*/ #include<stdio.h> void main() { int a; 【1】; if(a>0) printf("z\n"); if(【2】) printf(" 阅读全文
posted @ 2023-02-07 22:08 myrj 阅读(414) 评论(0) 推荐(0) 编辑
摘要: /*给出一个百分制的成绩要求输出成绩等级“A”、“B”“C” “D”“E”。90分以上的为“A”级80~89分的为“B”70~79 分的为“C”60~69分的为“D”60分以下的为“E”。*/ #include <stdio.h> main() { int grade; scanf( 阅读全文
posted @ 2023-02-07 22:04 myrj 阅读(345) 评论(0) 推荐(0) 编辑
摘要: /*从键盘输入一个4位正整数求其各位数字之积并输出。例如 若输入2523则输出应该是60。*/ #include <stdio.h> main() { int n,【1】,s,b,q,m; scanf("%d",【2】); q=n/1000; 【3】 s=n/10%10; g=n%10; m 阅读全文
posted @ 2023-02-07 21:40 myrj 阅读(33) 评论(0) 推荐(0) 编辑
摘要: //已知三角形两边及夹角(角度制),求第三边及面积 #include<stdio.h> 【1】 【2】 main() {float a,b,c,alfa,s; 【3】 scanf("%f %f %f",&a,&b,&alfa); 【4】 c=sqrt(a*a+b*b-2*a*b*cos(alfa)) 阅读全文
posted @ 2023-02-07 21:09 myrj 阅读(116) 评论(0) 推荐(0) 编辑
摘要: /*输入年份判断闰年*/ //闰年的判断依据是:若某年能被4整除,但不能被100整除,则这一年是闰年;若某年能被400整除,则这一年也是闰年 #include<stdio.h> main() { int yyear,【1】; printf(" 闰年查询 \n 请输入要查询的年份 :\n"); sca 阅读全文
posted @ 2023-02-07 20:38 myrj 阅读(65) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> /*输入3个实数 a, b, c要求按从大到小的顺序输出三数.*/ main( ) { float a,b,c,t; scanf("%f,%f,%f",&a,&b,&c); if (a<b) {t=a; 【1】 ; b=t;} if( 【2】 ) {t=a; a 阅读全文
posted @ 2023-02-07 20:32 myrj 阅读(164) 评论(0) 推荐(0) 编辑
摘要: /*有一函数: y= x (x<10) 输入x的值,求y的值。 y=3x -2 (10≤x<50) y=4x+1 (50≤x<100) y=5x (x≥100)*/ 【6】 void main() { int x,y; 【1】 t; printf("input x=:"); scanf("【2】", 阅读全文
posted @ 2023-02-07 20:28 myrj 阅读(171) 评论(0) 推荐(0) 编辑
摘要: /*功能为:输入1个字母后,输出该字母的前序字母、该字母、该字母的后序字母, 例如:输入g,则输出fgh;输入a,则输出zab;输入M,则输出LMN;输入Z,则输出YZA。*/ #include <stdio.h> void main() { char ch,c1,c2; printf("Enter 阅读全文
posted @ 2023-02-07 20:12 myrj 阅读(270) 评论(0) 推荐(0) 编辑
摘要: /*:按下列公式计算并输出x的值。其中a和b的值由键盘输入,并保留3位小数。 x=2ab/(a+b)^2*/ #include <stdio.h> void main() { int a,b; 【4】; scanf("%d,%d",【1】); x=【2】; printf("x=【3】\n",x); 阅读全文
posted @ 2023-02-07 19:47 myrj 阅读(50) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //程序功能:求s=2+4+6+8+...+100 并输出结果 //【】位置需要填写相应内容,保证程序能正常运行,无警告提示。 main() { 【1】; for(;a<=【2】;a++) { s=【3】; 【4】 } printf("s=%d\n",【5】); 阅读全文
posted @ 2023-02-07 19:32 myrj 阅读(88) 评论(0) 推荐(0) 编辑
摘要: /* 下列程序的功能为:实现加、减、乘、除四则运算。*/ //【1】【2】【3】【4】【5】【6】【7】【8】【9】【10】 #include <stdio.h> void main() { int a,b,d; char ch; printf("Please input a expression: 阅读全文
posted @ 2023-02-07 18:54 myrj 阅读(128) 评论(0) 推荐(0) 编辑
摘要: /* 程序的功能为:判断从键盘上输入的一个字符,并按下列要求输出。 若该字符是数字 输出字符串"0-9" 若该字符是大写字母 输出字符串"A-Z" 若该字符是小写字母 输出字符串"a-z" 若该字符是其他字符 输出字符串"!,@,…" */ #include <stdio.h> void main( 阅读全文
posted @ 2023-02-07 18:46 myrj 阅读(237) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //程序功能:输入一个6*6矩阵,将其主对角线上的元素置1,次对角线置-1,其余元素为0 main() { int 【1】; int i,j; for(i=0;【2】;i++) { 【3】=1; 【4】=-1; } for(i=0;i<=5;i++) { for 阅读全文
posted @ 2023-02-07 17:16 myrj 阅读(347) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //程序功能:输入一行字符,分别统计其中英文字母、数字和其他字符的个数 main() { char c; int i=0,j=0,k=0; while(【1】) { if(c>='0' && c<='9') 【2】; else if(【3】) j++; else 阅读全文
posted @ 2023-02-07 17:12 myrj 阅读(82) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //程序功能:求s=1+2+3+4+5+....+100 //【】位置需要填写相应内容,保证程序能正常运行,无警告提示。 main() { 【1】; for(a=1;a<=【2】;a++) s=【3】; printf("s=%d\n",【4】); getchar 阅读全文
posted @ 2023-02-07 14:41 myrj 阅读(72) 评论(0) 推荐(0) 编辑
摘要: //交换任意两个整型变量的值 //【】位置需要填写相应内容,保证程序能正常运行,无警告提示。 【1】 main() { int a=1,b=2; printf("a=%d,b=%d\n",a,b); a=【2】; b=【3】; a=【4】; printf("a=%d,b=%d\n",a,b); ge 阅读全文
posted @ 2023-02-07 14:35 myrj 阅读(52) 评论(0) 推荐(0) 编辑
摘要: Python使用requests時遇到Failed to establish a new connection解决方法:但是程式邏輯的關係我會在短時間使用多次requests.post其結果就是跳出了Failed to establish a new connection這樣一個錯誤google一下 阅读全文
posted @ 2023-02-07 08:51 myrj 阅读(920) 评论(0) 推荐(0) 编辑