1007 The Vampire fight

Source: Internet
Author: User

There are legends of vampires (vampire). Vampire fights are vampires and enemies taking turns attacking each other. Vampire and enemy both have blood and attack two indicators, who first without blood, who will lose. Every time a vampire attacks an enemy, the amount of blood the enemy loses is equal to the vampire's attack. Every time an opponent attacks a vampire, the amount of blood the vampire loses is equal to the enemy's attack. The vampire fight, always by the enemy first attack, and then turn to vampire attacks, in turn. This question wants to know the vampire wins and loses in every battle.

Only 1 lines, consisting of 4 integers. First enter the vampire's initial amount of blood and attack, then enter the enemy's initial blood volume and attack.

If the vampire wins, the output is win; if the vampire loses, the output lose.

90 10 90 37


Lose


#include "stdio.h"
int main ()
{
int a,a1,b,b1;
scanf ("%d%d%d%d", &A,&A1,&B,&B1);
if (B/A1>A/B1)
printf ("lose\n");
else if (B/A1<A/B1)
{
if ((B%A1) && (a%b1==0))
printf ("lose\n");
else if ((b%a1==0) && (A%B1))
printf ("win\n");
Else
printf ("win\n");
}
else if (B/A1==A/B1)
{
if ((B%A1) && (a%b1==0))
printf ("lose\n");
else if ((b%a1==0) && (A%B1))
printf ("win\n");
Else
printf ("lose\n");

}
return 0;
}

1007 The Vampire fight

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.