為啥運行不了?
struct?Student
{
????int?math;
????int?english;
}
int?main(int?argc,char?**argv)
{
????struct?Student?stu[50];
????//為其中一個學生的成績賦值
????stu[20].math?=?90;
????stu[20].english?=?95;
????return?0;
}struct?Student
{
????int?math;
????int?english;
}
int?main(int?argc,char?**argv)
{
????struct?Student?stu[50];
????//為其中一個學生的成績賦值
????stu[20].math?=?90;
????stu[20].english?=?95;
????return?0;
}2022-11-18
舉報
2023-03-11
你的struct是錯的,在大括號之后需要加 ;?
2023-01-20
struct?Student { ????int?math; ????int?english; }; int?main(int?argc,char?**argv) { ????struct?Student?stu[50]; ????//為其中一個學生的成績賦值 ????stu[20].math?=?90; ????stu[20].english?=?95; ????return?0; }你只要在代碼
struct?Student { ????int?math; ????int?english; };(這里加上一個分號‘;’就行了)2022-11-22
struct Student
{
int math;
int english;
};
int main(int argv,char **argv)
{
struct Student stu[50];
stu[20].math=93;
stu[20].english=95;
return 0;
}
2022-11-19
我覺得你可以在
struct?Student { ????int?math; ????int?english; }后加一個";".