Advertisement
raimundolazaro

batalha pokemon

Mar 21st, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.05 KB | None | 0 0
  1. #include <stdio.h>
  2. // o pokemon mais rápido pode usar sua habilidade primeiro. Cada pokemon tem uma quantidade inteira de vida V e um dano inicial inteiro D.
  3. //clodes ataca primeiro
  4. //Bezaliel de dano constante
  5. //clodes ataque de amento de dano
  6. int main()
  7. {
  8.     int bat,i,vida1,vida2,dano1,dano2,contg1,contg2;
  9.     scanf("%d",&bat);
  10.     while(scanf("%d %d %d %d",&vida1,&vida2,&dano1,&dano2)!=EOF && i<=bat){
  11.         i++;
  12.         contg1=0;
  13.         contg2=0;
  14.         //for para Bezaliel v2 d2
  15.         for(;vida2!=0;vida2-dano2){
  16.             contg1++;
  17.            
  18.         }
  19.         //for para clodes v1 d1
  20.         for(;vida1!=0;vida1-dano1){
  21.             contg2++;
  22.             dano1=dano1+50;
  23.         }
  24.         if(contg1<contg2){
  25.             printf("Bezaliel");
  26.         }
  27.         else{
  28.             if(contg1>contg2){
  29.                 printf("clodes");
  30.             }
  31.             else{
  32.                 if(contg1=contg2){
  33.                     printf("clodes");
  34.                 }
  35.             }
  36.            
  37.         }
  38.     }    
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement