#include <stdio.h>
int i;
struct data
{
char name[10];
int rank;
int score;
}grade[11];
void input()
{
FILE*in=fopen("input.txt", "r");
for(i=0;i<10;i++) {
fscanf(stdin, "%s %d", grade[i].name, &grade[i].score);
}
fclose(in);
}
void output()
{
FILE*out=fopen("output.txt", "w");
printf(" À̸§ Á¡¼ö µî¼ö\n");
for(i=0;i<10;i++) {
fprintf(stdout, "%6s %4d %4d\n", grade[i].name, grade[i].score, grade[i].rank);
}fclose(out);
}
void mix()
{
int j;
grade[0].rank=1;
for(i=0;i<9;i++) {
for(j=i+1;j<10;j++) {
if(grade[i].score<grade[j].score) {
grade[10].rank = grade[i].rank;
grade[i].rank=grade[j].rank;
grade[j].rank=grade[10].rank;
}
}
}
}
int main()
{
input();
mix();
output();
return 0;
}
·Î Çߴµ¥ runtime error¶ó°í ¶ß´Âµ¥ ¿À·ù°¡ ¾îµð¼ ¹ß»ýÇÑ °Ç°¡¿ä?