結構體要加上;程序才不會出錯
#include<stdio.h>
#include<iostream>
struct Student
{
? ? int math;
? ? int english;
};
int main(int argc,char **argv)
{
? ? struct Student stu[50];
? ? //其中一個學號為:21的學生成績賦值
? ? stu[20].math = 100;
? ? stu[20].english = 98;
}
#include<stdio.h>
#include<iostream>
struct Student
{
? ? int math;
? ? int english;
};
int main(int argc,char **argv)
{
? ? struct Student stu[50];
? ? //其中一個學號為:21的學生成績賦值
? ? stu[20].math = 100;
? ? stu[20].english = 98;
}
2021-05-29
舉報
2023-02-25
感謝哦??
2021-07-21
感謝。struct要加分號。記住了。