|
|
back to boardWA-1 What's wrong? all my tests are right. #include <stdio.h> #include <string.h> #include <stdlib.h> int main() { int n; int i,j; int kolvo_brendov=1; int nayden_povtor=0; char temp[31]; char all[1000][31]; scanf("%d",&n); if (n==0) { printf("0"); return 0; } fflush(stdin); fgets(all[0],31,stdin); for (i=1;i<n;i++) { fgets(temp,31,stdin); for(j=0;j<kolvo_brendov;j++) {if (!strcmp(all[j],temp)) { nayden_povtor=1; } } if (!nayden_povtor) { kolvo_brendov++; strcpy(all[kolvo_brendov-2],temp); } nayden_povtor=0; } printf("%d",n-kolvo_brendov); return 0; } |
|
|