Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4.  
  5. int main(){
  6. float value;
  7. float balance;
  8. scanf("%f", &value);
  9. scanf("%f", &balance);
  10. if(fmod(value, 5)==0 && balance-value-0.5>=0){
  11. printf("%.2f", balance-value-0.5);
  12. }
  13. else
  14. {
  15. printf("%.2f", balance);
  16. }
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement