|
|
back to boardWhat is wrong? WA1 #include <conio.h> #include <algorithm> #include <iostream> #include <cstdio> #include <stdio.h> #include <string.h> using namespace std; int povtor (char str[31],char mas2[1001][31],int mas2len) { int i; for (i=0; i<mas2len; i++) { if (strcmp(str,mas2[i])==0) return 0; } return 1; } int main() { int N; char mas[1001][31]; char mas2[1001][31];
int mas2len=0;
cin >> N; for (int i=0; i<N; i++) { cin >> mas[i]; }
for (int i=0; i<N; i++) { if (povtor(mas[i],mas2,mas2len)) strcpy(mas2[mas2len++],mas[i]); }
cout << N-mas2len;
getch(); } |
|
|