The King of Fighters 1002

Original link: http://www.cnblogs.com/1023x/p/5572030.html

The King of Fighters 2002 is a classic fighting game, the main process is the two parties each choose a character attack each other until one blood is 0 and the other to win. Here we look at simplifying the process, the first attack by the left crazy Iori, then to the right again Kyrgyz Howard attack. Then loop until either the end of the blood to zero game.

Now tell your crazy Iori and Kyrgyz Howard both their health and the role of attack damage. Can you tell me is crazy Iori victory, it was Howard Guice?

Input: only one row, a total of four integers. The first two integers represent health and attack damage insane Iori, two behind the
integer representation Kyrgyz Howard's health and attack damage.

Output: Left or Right, Left represents the victory of crazy Iori, Right represents the Kyrgyz Howard victory.

 

#include"stdio.h"
int main()
{
int a,a1,b,b1;
scanf("%d%d%d%d",&a,&a1,&b,&b1);
if(a/b1>b/a1)
printf("Left\n");
else if(a/b1<b/a1)
{
if((a%b1)&&(b%a1==0))
printf("Left\n");
else if((a%b1==0)&&(b%a1))
printf("Right\n");
else
printf("Right\n");
}
else if(a/b1==b/a1)
{
if((a%b1)&&(b%a1==0))
printf("Left\n");
else if((a%b1==0)&&(b%a1))
printf("Right\n");
else
printf("Left\n");

}
return 0;
}

Reproduced in: https: //www.cnblogs.com/1023x/p/5572030.html

Guess you like

Origin blog.csdn.net/weixin_30432179/article/details/94790309