UVA Problem 10221 ( Satellites) Solution

Problem Solving, UVa

#include<bits/stdc++.h>

#define PI acos(-1)

using namespace std;





int main ()

{

  double dis_of_sate ,angle,r;

   char s[4];

   while(cin>>dis_of_sate>>angle>>s) // circle (arc) length s=r*theta. (chord) length = 2*rsin(C/2)

   {

       if(s[0]=='m') angle/=60;

       if(angle>180)

       angle=360-angle; // tribhujer kono kon 180 er boro hoy na

       r=dis_of_sate + 6440;

       angle=PI*angle/180;

  

    printf("%.6lf %.6lf\n",r*angle,2*r*sin(angle/2));

}

    return 0;

}

 

0 Comments

You may find interest following article

Chapter 4 Relational Algebra

Relational Algebra The part of mathematics in which letters and other general symbols are used to represent numbers and quantities in formula and equations. Ex: (x + y) · z = (x · z) + (y · z). The main application of relational algebra is providing a theoretical foundation for relational databases, particularly query languages for such databases. Relational algebra...

Chapter 3 Components of the Database System Environment

Components of the Database System Environment There are five major components in the database system environment and their interrelationships are. Hardware Software Data Users Procedures Hardware:  The hardware is the actual computer system used for keeping and accessing the database. Conventional DBMS hardware consists of secondary storage devices, usually...

Chapter 2: Database Languages and their information

Database Languages A DBMS must provide appropriate languages and interfaces for each category of users to express database queries and updates. Database Languages are used to create and maintain database on computer. There are large numbers of database languages like Oracle, MySQL, MS Access, dBase, FoxPro etc. Database Languages: Refers to the languages used to...