SHARE
TWEET

Untitled

a guest Nov 21st, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. void loop(char tam, int caixa, int count, int cafe, int soma)
  4. {
  5.    if(count == 7)
  6.  {
  7.    printf("%d\n", soma);
  8.    printf("%d", soma *(2)/(7));
  9.    return;
  10.  }
  11. scanf("%d\n", &caixa);
  12. scanf("\n%c", &tam);
  13.  
  14. if (tam =='G' || tam=='g')
  15.  {
  16.    cafe = (16 * caixa);
  17.     {
  18.      loop(tam, caixa, count+1, cafe, soma+cafe);
  19.     }
  20.  }
  21. else if (tam=='P' || tam=='p')
  22.  {
  23.    cafe = (10 * caixa);
  24.    {
  25.       loop(tam, caixa, count+1, cafe, soma+cafe);
  26.    }
  27.  }
  28. }
  29.  
  30. int main()
  31. {
  32. int caixa, count, cafe, soma;
  33. char tam;
  34. loop(tam, caixa, 0, cafe, 0);
  35. return 0;
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top