Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C by 110062336 ( 5 years ago )
# include<stdio.h>

int main ()
{
    int P_HP, P_ATK, P_DEF;
    int E_HP, E_ATK, E_DEF;
    scanf("%d %d %d",&P_HP, &P_ATK, &P_DEF);
    scanf("%d %d %d",&E_HP, &E_ATK, &E_DEF);
    printf("Battle Start \\^_^/\n");
    while (P_HP && E_HP >0)
    {
        printf("The player dealt %d damage to the enemy and the enemy dealt %d damage to the player\n",P_ATK-E_DEF,E_ATK-P_DEF);
        printf("The player has %d HP left and the enemy has %d HP left\n",P_HP-(E_ATK-P_DEF),E_HP-(P_ATK-E_DEF));
        P_HP = P_HP-(E_ATK-P_DEF);
        E_HP = E_HP-(P_ATK-E_DEF);
    }
    printf("Battle End \\^_^/\n");
    return 0;
}

 

Revise this Paste

Your Name: Code Language: