#include <stdio.h>
#include <string.h>
int main()
{
int times , count1 , count2 , count3 , count4 , correct ;
char array[100000][5] , temp[5] ;
while ( scanf("%d" , × ) == 1 )
{
count2 = 0 ;
for ( count1 = 0 ; count1 < times ; count1++ )
{
scanf("%s" , temp);
correct = 0;
for ( count3 = 0 ; count3 < count2 ; count3++ )
{
for ( count4 = 0 ; count4 < 5 ; count4++ )
{
if ( array[count3][count4] != temp[count4] )
break;
}
if ( count4 == 5 )
{
printf("Old! %d\n" , count3 + 1 );
correct = 1;
break;
}
}
if ( correct == 0 )
{
printf("New! %d\n" , count2 + 1 );
strcpy(array[count2] , temp );
count2++;
}
}
}
return 0;
}
有辦法更快嗎?
我黔驢繼窮了......
請高手賜教