各位大神帮帮忙吧

YKYBtao 2020-04-29 02:01:38
键盘输入学生的学号(两位数),生日(8位数),性别,语文和数学成绩,求出平均分,显示输出这个学生所有的信息包括平均分)。
...全文
103 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
引用 8 楼 ?Victor.?? 的回复:
确实这里也挺好玩的

感觉二哈更有意思
孤远无梦 2020-04-29
  • 打赏
  • 举报
回复
引用 7 楼 点点吃得太多了 的回复:
[quote=引用 6 楼 ?Victor.?? 的回复:] [quote=引用 4 楼 点点吃得太多了 的回复:] [quote=引用 2 楼 ?Victor.?? 的回复:] ]
中流抵柱[/quote] 老男人怎么在水区和这里 双线作战?[/quote] 水区, 散光分, 就不去了, 在这里, 找小白[/quote] 确实这里也挺好玩的
  • 打赏
  • 举报
回复
引用 6 楼 ?Victor.?? 的回复:
[quote=引用 4 楼 点点吃得太多了 的回复:]
[quote=引用 2 楼 ?Victor.?? 的回复:]
]

中流抵柱[/quote]
老男人怎么在水区和这里
双线作战?[/quote]
水区, 散光分, 就不去了,
在这里, 找小白
孤远无梦 2020-04-29
  • 打赏
  • 举报
回复
引用 4 楼 点点吃得太多了 的回复:
[quote=引用 2 楼 ?Victor.?? 的回复:] ]
中流抵柱[/quote] 老男人怎么在水区和这里 双线作战?
  • 打赏
  • 举报
回复
引用 3 楼 5250 的回复:
}

分享达人
  • 打赏
  • 举报
回复
引用 2 楼 ?Victor.?? 的回复:
]

中流抵柱
5250 2020-04-29
  • 打赏
  • 举报
回复
[color#include <stdio.h>

typedef struct
{
int no;
char birth[9];
char sex[8];
float Chi_score;
float Math_score;
float ave;
}Stu;

int main()
{
Stu stu;
printf("输入学号:");
scanf("%d",&stu.no);
printf("输入生日:");
scanf("%s",stu.birth);
printf("输入性别:");
scanf("%s",stu.sex);
printf("输入语文成绩:");
scanf("%f",&stu.Chi_score);
printf("输入数学成绩:");
scanf("%f",&stu.Math_score);
printf("学生信息如下:\n");
stu.ave = (stu.Chi_score + stu.Math_score)/2;
printf("学号:%d 生日:%s 性别:%s 语文成绩:%.1f 数学成绩:%.1f 平均成绩:%.1f",stu.no,stu.birth,stu.sex,stu.Chi_score,stu.Math_score,stu.ave);
return 0;
}
孤远无梦 2020-04-29
  • 打赏
  • 举报
回复
#include<stdio.h>
//空格间隔输入 
int main()
{
	int a;
	double ch,ma;
	char birth[8];
	char sex;
	printf("输入学号,生日,性别,语文,数学成绩:\n");
	scanf("%d",&a);
	char x = getchar();
	for(int i = 0; i < 8; i++)
	{
		scanf("%c",&birth[i]);
	}
	x = getchar();
	scanf("%c%lf%lf",&sex,&ch,&ma);
	printf("学号:%d\n生日:",a);
	for(int i = 0; i < 8; i++)
		printf("%c",birth[i]);
	printf("\n性别:%c\n语文成绩:%f\n数学成绩:%f\n平均分:%f",sex,ch,ma,(ch+ma)/2);
	return 0;
}
YKYBtao 2020-04-29
  • 打赏
  • 举报
回复
没人吗?

15,440

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧