3/16/2013

11984 A Change in Thermal Unit - UVA


  1. #include<iostream>
  2. #include<iomanip>  //for setprecision()
  3. using namespace std;
  4. int main ()  
  5. {
  6.         int testCases ;
  7.         float cel , incInFahr ; //for celsuis , and the increse in fahrenheit
  8.         float fahrenheit;
  9.         cin>>testCases;
  10.         for(int i=0; i<testCases ; i++)
  11.         {
  12.                 cin>>cel>>incInFahr;
  13.                 fahrenheit = (((cel * 9)/5)+32 ) ;
  14.                 fahrenheit +=incInFahr;
  15.                 cel = ((fahrenheit - 32) * 5/9);
  16.                
  17.                 cout<<"Case "<<i+1<<": "<<fixed<<setprecision(2)<<cel<<endl;
  18.         }
  19.         return 0;
  20. }

You can find more of my solutions on Here

No comments:

Post a Comment