From 8a1b1f861eef4285a0c2d5999dc993861ce01f41 Mon Sep 17 00:00:00 2001 From: pu7icvtwj Date: Fri, 22 Nov 2024 11:18:08 +0800 Subject: [PATCH] ADD file via upload --- $R3K9GBZ.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 $R3K9GBZ.cpp diff --git a/$R3K9GBZ.cpp b/$R3K9GBZ.cpp new file mode 100644 index 0000000..9b25104 --- /dev/null +++ b/$R3K9GBZ.cpp @@ -0,0 +1,46 @@ +#include +int main(){ + int i,j; + char c; + for(i=0;i<30;i++){ + printf(" "); + } + printf("1.Input\n"); + for(i=0;i<30;i++){ + printf(" "); + } + printf("2.Output\n"); + for(i=0;i<30;i++){ + printf(" "); + } + printf("3.Order\n"); + for(i=0;i<30;i++){ + printf(" "); + } + printf("4.Quit\n"); + scanf("%c",&c); + switch(c){ + case('i'):printf("You are trying to Input info");break; + case('o'):printf("You are trying to Output info");break; + case('m'):printf("You are trying to Make things ordered");break; + case('q'):printf("You are about to Quit");break; + default:printf("Wrong input");break; + } + {struct student + {int num; + float grade_m; + float grade_p; + float grade_e; + } student1,student2,student3; + + + scanf("%d%f%f%f",&student1.num,&student1.grade_m,&student1.grade_p,&student1.grade_e); + scanf("%d%f%f%f",&student2.num,&student2.grade_m,&student2.grade_p,&student2.grade_e); + scanf("%d%f%f%f",&student3.num,&student3.grade_m,&student3.grade_p,&student3.grade_e); + printf("%d %.1f %.1f %.1f %.1f",student1.num,student1.grade_m,student1.grade_p,student1.grade_e,student1.grade_m+student1.grade_p+student1.grade_e); + printf("%d %.1f %.1f %.1f %.1f",student2.num,student2.grade_m,student2.grade_p,student2.grade_e,student2.grade_m+student2.grade_p+student2.grade_e); + printf("%d %.1f %.1f %.1f %.1f",student3.num,student3.grade_m,student3.grade_p,student3.grade_e,student3.grade_m+student3.grade_p+student3.grade_e); + + +} +}