diff --git a/xjxt2.cpp b/xjxt2.cpp new file mode 100644 index 0000000..ee8de6b --- /dev/null +++ b/xjxt2.cpp @@ -0,0 +1,23 @@ +#include +struct s { + int num; + float m; + float p; + float e; +}; +int main() +{ + struct s stu[3]; + int i; + float sum; + for(i=0;i<3;i++) + scanf("%d %f %f %f",&stu[i].num,&stu[i].m,&stu[i].p,&stu[i].e); + + for(i=0;i<3;i++) + { + sum=stu[i].m+stu[i].p+stu[i].e; + printf("%d %.1f %.1f %.1f %.1f\n",stu[i].num,stu[i].m,stu[i].p,stu[i].e,sum); + } + return 0; +} +