1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #include <iostream>
- #include <string>
- #if(0)
- struct Student
- {
-
- std::string name;
-
- int age;
-
- int score;
- };
- int main()
- {
-
- struct Student stuArry[8] =
- {
- {"张三" , 18 , 100},
- {"李四" , 28 , 99},
- {"王五" , 38 , 66}
- };
-
- stuArry[2].name = "赵六";
- stuArry[2].age = 80;
- stuArry[2].score = 60;
-
-
- for (int i = 0; i < 3; i++)
- {
- std::cout << "姓名:" << stuArry[i].name
- << "年龄:" << stuArry[i].age
- << "分数:" << stuArry[i].score
- << std::endl;
- }
- system("pause");
- return 0;
- }
- #endif
|