在2019VS上运行不出来,咋回事?
#include<stdio.h>struct student { //学生信息结构定义
int num; //学号
char name[10]; //姓名
int computer, english, math; //三门课成绩
double average; //个人平均分
};
int main(void)
{
int i, n;
struct student s1, max; //定义结构变量
printf("Input n:");
scanf_s("%d", &n);
printf("Input the student's number,name and course scors\n");
for (i = 1; i <= n; i++)
{
printf("No.% d:", i);
scanf_s("%d%s%d%d%d", &s1.num, s1.name, &s1.math, &s1.english, &);//此处提示波浪线
s1.average = (s1.math + s1.english + ) / 3.0; //此处提示波浪线
if (i == 1) max = s1;
if (max.average < s1.average)
max = s1;
}
printf("num:% d,name:% s,average:% .2lf\n", max.num, max.name, max.average); //max.average中max提示未使用初始化内存
return 0;
}