1002 Boxing King

Source: Internet
Author: User

Boxing King 2002 is a very classic fighting game, the main process is that both sides choose a role to attack each other until one side of the blood volume of 0, the other side can win. Here we simplify the process, from the left crazy eight gods first attack, and then to the right Gishoward again attack. Then loop until the end of the 0 game for one side of the blood volume.

Now tell you crazy eight-god and Gishoward two-party characters ' respective health values and attack damage. Can you tell me if it's a crazy eight-god victory or a Gishoward?

Input: Only 1 lines, total four integers. The first two integers represent the insane eight gods ' health and attack damage, followed by two
The integer represents the health value and attack damage of Jimmy Howard.

Output: Left or right,left means crazy eight-god victory, right means that Jimmy Howard wins.

#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;
}

1002 Boxing King

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.