-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheverywhere.cpp
More file actions
46 lines (35 loc) · 779 Bytes
/
Copy patheverywhere.cpp
File metadata and controls
46 lines (35 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <iostream>
using namespace std;
int main() {
int t;
int n[50];
string name[100];
bool flag = 0;
int numCities[50];
//do
cin >> t;
//while (t <= 1 && t >= 50);
for (int i = 0; i < t; i++) {
numCities[i] = 0;
//do {
cin >> n[i];
//} while (n[i] <= 1);
for (int j = 0; j < n[i]; j++) {
//do {
cin >> name[j];
//} while (name[j].length() > 20);
flag = 1;
for (int k = 0; k < j; k++) {
if (name[k] == name[j]) {
flag = 0;
}
}
if (flag == 1) numCities[i] += 1;
}
}
for (int i = 0; i < t; i++) {
cout << numCities[i] << "\n";
}
system("pause");
return 0;
}