Advertisement
noshin98

uva 10221

Jan 6th, 2017
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdio>
  3. #include<algorithm>
  4. #include<cstring>
  5. #include<string>
  6. #include<sstream>
  7. #include<math.h>
  8. #define pi 2*acos(0.0)
  9. using namespace std;
  10. int main() {
  11.  double s, a;
  12.  char str[5];
  13.  while (scanf("%lf%lf%s", &s, &a, str) == 3) {
  14.  s += 6440;
  15.  if (a > 180)
  16.  a = 360 - a;
  17.  if (!strcmp(str, "min"))
  18.  a = a / 60.0;
  19.  a = (pi * a) / 180.0;
  20.  printf("%0.6lf %0.6lf\n", s * a, 2 * s * sin(a / 2.0));
  21.  }
  22.  return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement