Advertisement
Guest User

Untitled

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