4条回答 默认 最新
- CSDN专家-赖老师(软件之家) 2021-05-31 08:41关注
部分功能代码,按照这个完善一下就可以。
#include "stdio.h" #define N 2 struct Student { //学号 int num; //成员变量或者一个数据项 //姓名 char name[20]; //性别 char sex; //M,F //成绩 float html; float ppt; float cyuyan; float sum; }st[N]; void input(); void display(); void main() { input(); display(); } //输入函数 void input() { int i; for(i=0;i<N;i++) { printf("请输入第%d个学生的学号,姓名,性别,html,ppt,cyuyan:",i+1); scanf("%d",&st[i].num); scanf("%s ",st[i].name); scanf("%c ",&st[i].sex); scanf("%f",&st[i].html); scanf("%f",&st[i].ppt); scanf("%f",&st[i].cyuyan); st[i].sum = st[i].html+st[i].ppt+st[i].cyuyan; } }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 PADS Logic 原理图
- ¥15 PADS Logic 图标
- ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
- ¥20 气象站点数据求取中~
- ¥15 如何获取APP内弹出的网址链接
- ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
- ¥50 STM32单片机传感器读取错误
- ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据
- ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)
- ¥15 机器人轨迹规划相关问题