零昏了,显示too short
查看原帖
零昏了,显示too short
215443
speeder楼主2023/3/9 20:38

样例正常过了,计算应该没问题吧,能不能帮忙看看是哪不对。

#include<iostream>
using namespace std;

struct student
{
	char name[20];
	int age, score;
}list[10];

int main()
{
	int n;
	cin >> n;
	cin.get();
	for (int i = 0; i < n; i++)
	{
		cin.getline(list[i].name, 20, ' ');
		cin >> list[i].age >> list[i].score;
		cin.get();
	}
	for (int i = 0; i < n; i++)
	{
		list[i].score += list[i].score / 5;
		if (list[i].score > 600)
			list[i].score = 600;
		cout << list[i].name << ' ' << ++list[i].age << ' ' << list[i].score << endl;
	}
}
2023/3/9 20:38
加载中...