diff --git a/README.md b/README.md index dc2a195..73471c8 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,28 @@ int main() } } +步骤2 +#include + +int main() +{ + struct student + { + int number; + float gaoshu; + float dawu; + float yy; + float add; + }student1, student2, student3; + scanf_s("%d%f%f%f", &student1.number, &student1.gaoshu, &student1.dawu, &student1.yy); + scanf_s("%d%f%f%f", &student2.number, &student2.gaoshu, &student2.dawu, &student2.yy); + scanf_s("%d%f%f%f", &student3.number, &student3.gaoshu, &student3.dawu, &student3.yy); + student1.add = (student1.gaoshu + student1.dawu + student1.yy); + student2.add = (student2.gaoshu + student2.dawu + student2.yy); + student3.add = (student3.gaoshu + student3.dawu + student3.yy); + printf("%d %f %f %f %f\n", student1.number, student1.gaoshu, student1.dawu, student1.yy, student1.add); + +printf("%d %f %f %f %f\n", student2.number, student2.gaoshu, student2.dawu, student2.yy, student2.add); + +printf("%d %f %f %f %f\n", student3.number, student3.gaoshu, student3.dawu, student3.yy, student3.add); +}