All my sample outputs are correct but getting WA
My code:
removed
10221 - Satellites
Moderator: Board moderators
10221 - Satellites Please help, what's wrong?
Last edited by NAbdulla on Sun Dec 28, 2014 7:39 am, edited 1 time in total.
Re: 10221 - Satellites Please help, what's wrong?
ac a bit tricky
-
- New poster
- Posts: 5
- Joined: Mon Jan 19, 2015 12:12 pm
- Location: University of Chittagong
Re: 10221 - Satellites
why i getting wrong Answer.....
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.
Reason: Added code blocks
Reason: Added code blocks
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 10221 - Satellites
Input:AC output:
Code: Select all
500 200 deg
Code: Select all
19380.136014 13669.131612
Check input and AC output for thousands of problems on uDebug!
-
- New poster
- Posts: 5
- Joined: Mon Jan 19, 2015 12:12 pm
- Location: University of Chittagong
Re: 10221 - Satellites
Thanks Accepted...