[Cpp]
/** The meaning of this question is that the corresponding equal values are strong and not equal values are weak,
* My practice is to copy a target string for each comparison and separate it with the input
* For string comparison, the statistics correspond to equal values, then the value is assigned to-1, and then the statistics are not
* Equal
*/
# Include <cstdio>
# Include <cstring>
# Include <algorithm>
Using namespace std;
Int main (int argc, char const * argv [])
{
Int cas, strong, week, * arr, * cmp, t, * arr1, n (0 );
While (scanf ("% d", & cas), cas ){
Printf ("Game % d: \ n", ++ n );
Arr = new int [cas + 1]; cmp = new int [cas + 1]; arr1 = new int [cas + 1];
For (int I = 0; I <cas; I ++ ){
Scanf ("% d", & arr [I]);
}
While (true ){
T = 0, strong = 0, week = 0;
For (int I = 0; I <cas; I ++ ){
Scanf ("% d", & cmp [I]);
Arr1 [I] = arr [I];
}
If (cmp [0] = 0) break;
For (int I = 0; I <cas; I ++ ){
If (arr1 [I] = cmp [I]) {
Strong ++;
Cmp [I] =-1; arr1 [I] =-1;
} Www.2cto.com
}
For (int I = 0; I <cas; I ++ ){
For (int j = 0; j <cas; j ++ ){
If (arr1 [I] = cmp [j] & arr1 [I]! =-1 ){
Week ++; cmp [j] =-1;
Break;
}
}
}
Printf ("(% d, % d) \ n", strong, week );
}
}
Return 0;
}