Facebook
From as, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 245
  1. #include <iostream>
  2. #include <string>
  3. #include <locale.h>
  4. #include <cmath>
  5. using namespace std;
  6. int main()
  7. {
  8.     setlocale(LC_CTYPE, "polish");
  9.     int a;
  10.     cout << "----Przelicznik----n";
  11.     cout << "1-F na C n";
  12.     cout << "2-CM na M n";
  13.     cout << "3-KG na LBS n";
  14.     cout << "4-G na OZ: n";
  15.     cout << "0-WYJSCIE n";
  16.  
  17.     while (bool j = true) {
  18.         cout << "Podaj numer: n";
  19.         cin >> a;
  20.  
  21.         if (a == 1) {
  22.             float c;
  23.             cout << "Podaj w F:n";
  24.             cin >> c;
  25.             float suma = (c - 32) * 5 / 9;
  26.             cout << c << "stopni F to " << suma << "stopni celsjuszan";
  27.         }
  28.         else if (a == 2) {
  29.             float cm;
  30.             cout << "Podaj w cm:n";
  31.             cin >> cm;
  32.             float suma1 = cm/100;
  33.             cout << cm << "centymetrow to " << suma1 << " metrown";
  34.         }
  35.         else if (a == 3) {
  36.             float kg;
  37.             cout << "Podaj kg:n";
  38.             cin >> kg;
  39.             float sum2 = kg * 2.2;
  40.            
  41.             cout << kg << " to " << ceil(sum2) << " lbsn";
  42.         }
  43.         else if (a == 4) {
  44.             float g;
  45.             cout << "Podaj g:n";
  46.             cin >> g;
  47.             float sum3 = g * 0.0352;
  48.  
  49.             cout << g << " to " << sum3 << " uncjin";
  50.         }
  51.         else if (a == 0) {
  52.             cout << "Dziekujemy ;)";
  53.             break;
  54.         }
  55.     }
  56.     }
  57.  
  58.  
  59.