Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.     char name1[100],name2[100],choice1[100],choice2[100];
  6.     int a,b,i,n,sum;
  7.     scanf("%d",&n);
  8.     for(i=0;i<n;i++)
  9.     {
  10.         gets(name1);
  11.          gets(choice1);
  12.           gets(name2);
  13.            gets(choice2);
  14.            scanf("%d%d",&a,&b);
  15.            sum=a+b;
  16.            if(choice1[0]=='P' &&choice1[1]=='A'&&choice1[2]=='R')
  17.            {
  18.                if(sum%2==0)
  19.  
  20.  
  21.  
  22.                 printf("%s",name1);
  23.  
  24.            }
  25.             if(choice2[0]=='P' &&choice2[1]=='A'&&choice2[2]=='R')
  26.            {
  27.                if(sum%2==0)
  28.                 printf("%s",name2);
  29.  
  30.            }
  31.  
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement