Advertisement
mhdew

Alternate

Jul 28th, 2019
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     double l, t;
  6.     int m;
  7.     scanf("%lf%lf%d", &l,&t,&m);
  8.  
  9.     if(m==1) t-=10;
  10.     else if(m==2) t-=20;
  11.     else t-=30;
  12.  
  13.     l/=1000;
  14.     t/=60;
  15.  
  16.     double s=l/t;
  17.     s*=100;
  18.     s=round(s);
  19.     s/=100;
  20.  
  21.     printf("%.2lf\n", s);
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement