摘要: #include <stdio.h> //->是一个整体,它是用于指向结构体子数据的指针,用来取子数据。 //换种说法,如果我们在C语言中定义了一个结构体,然后申明一个指针指向这个结构体, //那么我们要用指针取出结构体中的数据,就要用到->。 //计算四位学生的平均成绩,保存在结构体中,然后列表输 阅读全文
posted @ 2023-02-08 21:00 myrj 阅读(69) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //将字符串的所有的字符's'删除 ,并输出修改后的字符串 main() { char a[80]; int i,j; 【1】; for(【2】;a[i]!=【3】;i++) if(a[i]!='s') { 【4】=a[i]; j++; } a[j]=【5】; 阅读全文
posted @ 2023-02-08 20:35 myrj 阅读(272) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //数列的第1 2项值为1,此后各项值均为该项前二项之和,计算数列第30项的值 int f(int n); main() { printf("%d",【1】); getchar(); } int f(int n) { if(n==1 || n==2) 【2】; 阅读全文
posted @ 2023-02-08 20:26 myrj 阅读(21) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //将任意三个整数按 从小到大排序 void swap(【1】,【2】) { int temp; temp=*pa; *pa=*pb; *pb=temp; } main() { int a,b,c,temp; scanf("%d%d%d",&a,&b,&c); 阅读全文
posted @ 2023-02-08 20:19 myrj 阅读(168) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //求输入的整数各位数字之和。如输入234则输出9;输入-123则输出6 main() { int n,【1】; scanf("%d",&n) ; n=【2】; while(【3】) { s=s+【4】; n=【5】; } printf("%d",s); get 阅读全文
posted @ 2023-02-08 20:11 myrj 阅读(124) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> //将任意10进制整数转化为2-16任意进制 int main() { char ku[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; int zh[32],i=0,w, 阅读全文
posted @ 2023-02-08 20:04 myrj 阅读(85) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //将10进制正整数转化为二进制 【5】 dec2bin(int m) { int bin[32],j; for(j=0;【1】;j++) { bin[j]=【2】; m=【3】; } for(;【4】;j--) printf("%d",bin[j-1]); } 阅读全文
posted @ 2023-02-08 19:46 myrj 阅读(39) 评论(0) 推荐(0) 编辑
摘要: //功能:对=1,2,3,4,5,6,..,9,10 //求f(x)=x*x-5*x=sin(x)的最大值 并保留两位小数 #include <stdio.h> 【1】 【2】 f(x) x*x-5*x+sin(x) main( ) { int x;float max; max=【3】; for(x 阅读全文
posted @ 2023-02-08 19:36 myrj 阅读(26) 评论(0) 推荐(0) 编辑
摘要: //下面程序的运行结果为_______________。 #include"stdio.h" main( ) { int a=3,b=5,c=8; if(a++<3 && c--!=0) b=b+1; printf("a=%d,b=%d,c=%d\n",a,b,c); } a=4,b=5,c=8 阅读全文
posted @ 2023-02-08 19:24 myrj 阅读(15) 评论(0) 推荐(0) 编辑
摘要: //程序的功能是实现表达式z=( x>=y ? x : y),请将程序填写完整。 #include <stdio.h> main() { int x, y, z; printf("Please input x,y:"); scanf("%d%d",【1】); if 【2】 z=x; else 【3】 阅读全文
posted @ 2023-02-08 19:20 myrj 阅读(25) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> //判断指定字符是数字还是小写字母或大写字母或其他字符 main() {【1】 ch; printf("请输入一个字符"); scanf("【1】",【1】); if(【1】) printf("%c是大写字母",ch); else if(【1】) printf(" 阅读全文
posted @ 2023-02-08 15:49 myrj 阅读(741) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> //输入一元二次方程的系数a,b,c,判断是否有解,有几个解 main() {【1】 a,b,c,dt; printf("请输入一个a,b,c的值,a不能为0\n"); scanf("%f %f %f",【2】); dt=【3】; if(【4】) printf(" 阅读全文
posted @ 2023-02-08 15:40 myrj 阅读(256) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> //水仙花数:三位数的每个数字的立方和等于这个数, 判断某数是不是水仙花数 main() {【1】; printf("请输入一个水仙花数"); scanf("%d",【2】); g=【3】; s=【4】; b=【5】; if(【6】==x) printf("%d是 阅读全文
posted @ 2023-02-08 15:36 myrj 阅读(135) 评论(0) 推荐(0) 编辑
摘要: //任意输入三角形三边长,判断能否组成三角形,并求面积 【1】 【2】 main() {【3】 a,b,c,p,s; scanf("【4】",&a,&b,&c); if(【5】) {p=1/【6】*(a+b+c); s=sqrt(【7】); printf("三角形的面积是%f",s); } else 阅读全文
posted @ 2023-02-08 15:27 myrj 阅读(164) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> main() {int x; printf("请输入一个整数"); scanf("%d",【1】); if(【1】) printf("%d能被3整除",x); else printf("%d不能被3整除",x); } #include<stdio.h> main( 阅读全文
posted @ 2023-02-08 15:21 myrj 阅读(270) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> //判断指定年份是闰年还是平年 main() {int year; printf("请输入年数"); scanf("%d",【1】); if(【2】) printf("%d年是闰年",year); else if(year%【3】==0) printf("%d年是 阅读全文
posted @ 2023-02-08 15:17 myrj 阅读(167) 评论(0) 推荐(0) 编辑
摘要: /*输入日期,输出该天是该年的第几个。*/ #include<stdio.h> main() { int a,b,c,s=0; printf("请输入一个日期"); scanf("%d.%d.%d",&a,&b,&c); if(b==1) 【1】; if(b>1) s=s+31+c; if(b>2) 阅读全文
posted @ 2023-02-08 15:12 myrj 阅读(47) 评论(0) 推荐(0) 编辑
摘要: /*输入时间XX:XX:XX,输出一秒后对应的时间*/ #include<stdio.h> main() { int a,b,c; printf("请输入时间,格式为XX:XX:XX\n"); scanf("%d:%d:%d",&a,&b,&c); c++; if(【1】) { c=0; 【2】; 阅读全文
posted @ 2023-02-08 15:07 myrj 阅读(64) 评论(0) 推荐(0) 编辑
摘要: /*设圆半径r=1.5,圆柱高h=3,求圆周长,圆面积,圆球表面积,圆球体积,圆柱体积 用scanf输入数据,输出计算结果,输出时要求有文字说明,取小数后2位数字 球表面积公式 s=4*PI*r*r 球体积公式 v=4*pI*r*r/3 */ #include <stdio.h> 【7】 PI 3. 阅读全文
posted @ 2023-02-08 15:03 myrj 阅读(99) 评论(0) 推荐(0) 编辑
摘要: /*假设今天是星期日,编写一个程序,求123456天后是星期几*/ #include<stdio.h> int main() { int n,iday; printf("请输入天数:"); scanf("%d",【1】); 【2】; switch(【3】) { case 0:printf("%d天后 阅读全文
posted @ 2023-02-08 07:42 myrj 阅读(135) 评论(0) 推荐(0) 编辑