## 10221 - Satellites

Moderator: Board moderators

NAbdulla
New poster
Posts: 31
Joined: Wed Jul 30, 2014 3:40 pm
Contact:

All my sample outputs are correct but getting WA
My code:
removed
Last edited by NAbdulla on Sun Dec 28, 2014 7:39 am, edited 1 time in total.

NAbdulla
New poster
Posts: 31
Joined: Wed Jul 30, 2014 3:40 pm
Contact:

ac a bit tricky

Aseem chakrabarthy
New poster
Posts: 5
Joined: Mon Jan 19, 2015 12:12 pm
Location: University of Chittagong

### Re: 10221 - Satellites

Code: Select all

``````#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define PI 2*acos(0.0)
using namespace std;
int main()
{
double s,a;
string n;
double arc,chord;
while(cin>>s>>a>>n)
{
arc=s+6440;
if(n=="deg")
{
if(a>180)

a=360-a;

else
{

a=PI*a/180.0;
s=arc*a;
}

}

else
{
a=a/60.0;
a=PI*a/180.0;
s=arc*a;
}

chord=sqrt(2*arc*arc*(1-cos(a)));
cout<<fixed<<setprecision(6)<<s<<" "<<fixed<<setprecision(6)<<chord<<endl;
}
}``````
Last edited by brianfry713 on Fri Feb 06, 2015 10:39 pm, edited 1 time in total.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: 10221 - Satellites

Input:

Code: Select all

``````500 200 deg
``````
AC output:

Code: Select all

``````19380.136014 13669.131612
``````
Check input and AC output for thousands of problems on uDebug!

Aseem chakrabarthy
New poster
Posts: 5
Joined: Mon Jan 19, 2015 12:12 pm
Location: University of Chittagong

### Re: 10221 - Satellites

Thanks Accepted...