(C)用vs时只能读取一行??求助!!
查看原帖
(C)用vs时只能读取一行??求助!!
1102364
YuuSamm楼主2023/10/2 23:18

用的vs2022,写完后输入题例,按道理会读取三行,但只读了一行就退出了,也没返回0,不知道为什么,求解答!

#include <stdio.h>

struct STU {
	char name[25];
	int age;
	int score;
}stu[100001];

int main() {
	
	
	int n;
	scanf("%d", &n);	
	

	for (int i = 1; i <= n; i++) {
		scanf("%s %d %d", stu[i].name, &stu[i].age, &stu[i].score);
	}
	for (int j = 1; j <= n; j++) {
		
		stu[j].score *= 1.2;
		if (stu[j].score > 600) {
			stu[j].score = 600;
		}
		printf("%s %d %d", stu[j].name, stu[j].age + 1, stu[j].score);
	}
	return 0;
}
2023/10/2 23:18
加载中...