Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int qtd;
- double pr,gas;
- do{
- scanf("%d",&qtd);
- scanf("%lf",&pr);
- while(pr<0)
- {
- scanf("%lf", &pr);
- }
- gas=pr*qtd;
- }while(qtd>0);
- printf("%.2lf", gas);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement