Skip to content

Instantly share code, notes, and snippets.

@interpol-kun
Created June 5, 2014 15:24
Show Gist options
  • Save interpol-kun/c4de1ebe9fe07a9f7ef0 to your computer and use it in GitHub Desktop.
Save interpol-kun/c4de1ebe9fe07a9f7ef0 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
int revers(void)
{
for(k=0; k<20; k++);
{
wfname[k]=fname[k];
}
for(k=0; k<15; k++);
{
wsname[k]=sname[k];
}
}
int main(void)
{
char fname[21], sname[16], wfname[20], wsname[20];
int N, score, grade, amount, k, bestscore;
scanf("%d", &N);
bestscore=0;
amount=1;
for(int i=0; i<N; i++)
{
scanf("%s %s %d %d", fname, sname, &grade, &score);
if (score<200)
{
if (score !=0 && score==bestscore)
{
amount++;
}
if (score>bestscore)
{
revers()
}
}
}
if (amount>1)
{
printf("%d", amount);
}
else puts(wfname) && puts(wsname);
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment