All pastes #61700 Raw Edit

Unnamed

public text v1 · immutable
#61700 ·published 2006-06-04 13:41 UTC
rendered paste body
#include <iostream>

float licz(float);
float licz2(float);
float licz3(float);
#include <iostream>
using namespace std;
int main()
{
    int cos=0;
    int liczba;
    float tempcel;
    float tempfer;
    float tempkelw;
    while (!cos)
    {
    cout << "\n1. Stopnie celcjusza - stopnie fahrenheita\n2. Stopnie fahrenheita - stopnie celcjusza\n3. Stopnie celcjusza - stopnie Kelwina\n";
    cin >> liczba;
    if ( liczba == 1)
    {
         cout << "\nWpisz temp w cel: ";
         cin >> tempcel;
         tempfer = licz(tempcel);
         cout << "\nTemp w fer to: \n" << tempfer << endl;
         
     }
     else if ( liczba == 2)
     {
               cout << "\nWpisz temp w fer: ";
         cin >> tempfer;
         tempcel = licz2(tempfer);
         cout << "\nTemp w cel to: " << tempcel << endl;
     } else if ( liczba == 3)
     {
       cout << "\nWpisz temp w cel: ";
         cin >> tempcel;
         tempkelw = licz3(tempcel);
         cout << "\nTemp w kelw to: \n" << tempkelw << endl;     
            } 
     else cos=1;
     }
     return 0;
     }
     
     float licz(float tempcel)
     {
           float tempfer;
           tempfer = ((tempcel*9)/5)+32;
           return tempfer;
           }
           
     float licz2(float tempfer)
     {
           float tempcel;
           tempcel = ((tempfer - 32)*5)/9;
           return tempcel;
           }
     float licz3(float tempcel)
     {
           float tempkelw;
           tempkelw = (tempcel + 273,15 );
           return tempkelw;
           }