From 75989e5068d2bd32d9a6c04abe388d6d3edf928a Mon Sep 17 00:00:00 2001 From: p56isruwj <3475735425@qq.com> Date: Mon, 13 Nov 2023 22:30:19 +0800 Subject: [PATCH] ADD file via upload --- 学籍管理系统 步骤2.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 学籍管理系统 步骤2.c diff --git a/学籍管理系统 步骤2.c b/学籍管理系统 步骤2.c new file mode 100644 index 0000000..39fab86 --- /dev/null +++ b/学籍管理系统 步骤2.c @@ -0,0 +1,26 @@ +#include + +struct stu_info +{ + int num; + float math,physics,english,sum; +} +stu[3]; + +int main() +{ + int i; + for(i=0;i<3;i++) + { + scanf("%d",&stu[i].num); + scanf("%f",&stu[i].math); + scanf("%f",&stu[i].physics); + scanf("%f",&stu[i].english); + stu[i].sum=stu[i].math+stu[i].physics+stu[i].english; + } + for(i=0;i<3;i++) + { + printf("%d %.1f %.1f %.1f\n",stu[i].num,stu[i].math,stu[i].physics,stu[i].english,stu[i].sum); + } + return 0; +}