Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int qtd;
  5. double pr,gas_temp,gas;
  6. do{
  7. scanf("%d",&qtd);
  8. scanf("%lf",&pr);
  9. while(pr<0){
  10. scanf("%lf",&pr);
  11. }
  12.  
  13. gas_temp=pr*qtd;
  14. gas = gas + gas_temp;
  15. }while(qtd>0);
  16. printf("%.2lf", gas);
  17.  
  18.  
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement