這題就是看奇數點是不是大於2
所以用bool就行了(我真的好省
大概長成這樣
1 bool count_pass[cities]={false};
2 int start,end;
3 for (int i = 0; i < bridges; i++)
4 {
5 cin>>start>>end;
6 count_pass[start] = !count_pass[start];
7 count_pass[end] = !count_pass[end];
8 }