fork download
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.  
  6. int x,m;
  7. float y,k,i=0.50;
  8. //printf("Input:\n");
  9. scanf("%d\t%f",&x,&y);
  10. //scanf("%f",&y);
  11. //k=y-i;
  12. // m=x%5;
  13. if(x%5!=0)
  14. {
  15. // if(m!=0)
  16.  
  17. printf("%.2f\n",y);
  18. }
  19.  
  20. else{
  21. if(x+0.5>y)
  22. printf("%.2f\n",y);
  23. else
  24. printf("%.2f\n",y-x-0.5);
  25.  
  26. }
  27. /// if(x>y)
  28. {
  29. // printf("Output:\n%.2f\n",y);
  30. }
  31.  
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 2252KB
stdin
300 120.00
stdout
120.00