Advertisement
Guest User

Untitled

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