输入时出现错误
#include<stdio.h>struct node
{
char name[21];
int score;
};
int main()
{
struct node a[100], t;
int i, j, n;
scanf_s("%d", &n);
for (i = 1; i <= n; i++)
{
scanf_s("%s%d", a[i].name, &a[i].score);
}
for (i = 1; i <= n - 1; i++)
{
for (j = 1; j <= n - i; j++)
{
if (a[j].score < a[j + 1].score)
{
t = a[j]; a[j] = a[j + 1]; a[j + 1] = t;
}
}
}
for (i = 1; i <= n; i++)
{
printf_s("%s\n", a[i].name);
}
return 0;
}