Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdlib.h>
- #include<stdio.h>
- #include<fstream>
- #include<iostream>
- #include<math.h>
- #include<string.h>
- #define fi "msmind.inp"
- #define fo "msmind.out"
- using namespace std;
- int lech, trung;
- int a[2000], b[2000];
- int d_a[2000], d_b[2000];
- int n;
- void input()
- {
- int i, j;
- trung = 0;
- lech = 0;
- for(i = 0; i < n; i++)
- {
- scanf("%d",&a[i]);
- }
- b[0] = 0;
- for(i = 0; i < n; i++)
- {
- scanf("%d",&b[i]);
- }
- while(b[0] != 0)
- {
- trung = 0;
- lech = 0;
- for(i = 0; i < n; i++)
- {
- d_a[i] = 0;
- d_b[i] = 0;
- if(a[i] == b[i])
- {
- d_a[i] = 1;
- d_b[i] = 1;
- trung++;
- }
- }
- for(i = 0; i < n; i++)
- {
- if(d_a[i] == 0)
- {
- for(j = 0; j < n; j++)
- {
- if(d_b[j] == 0 && a[i] == b[j])
- {
- d_a[i] = 1;
- d_b[j] = 1;
- lech++;
- break;
- }
- }
- }
- }
- printf(" (%d,%d)\n",trung,lech);
- for(i = 0; i < n; i++)
- {
- scanf("%d",&b[i]);
- }
- }
- }
- void output()
- {
- }
- int main()
- {
- int test = 1;
- while (scanf("%d",&n) && n)
- {
- printf("Game %d:\n",test);
- test++;
- input();
- output();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement