Uri 1914:Whose Turn Is It?

Problem Link


Let’s make our turn 😉 \(^_^)/

<Source Code>

#include<stdio.h>
#include<string.h>
int main()
{
char a[1000],b[20],c[10000],d[20];
long long i,n,x,y;
scanf(“%lld”,&n);
while(n–)
{
scanf(“%s %s %s %s”,a,b,c,d);
scanf(“%lld %lld”,&x,&y);
i=x+y;
if(b[0]==’P’)
{
if(i%2==0)
printf(“%s\n”,a);
else
printf(“%s\n”,c);

}
else
{
if(i%2==0)
printf(“%s\n”,c);
else
printf(“%s\n”,a);

}
}
return 0;
}

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s