Advertisement
Kocyk

obiektowka1

Oct 11th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.05 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int liczba, menu;
  8.     cout << "Podaj liczbe" << endl;
  9.     cin >> setbase(0) >> liczba;
  10.  
  11.     do{
  12.         cout << "Co zrobic?" << endl;
  13.         cout << "1. Podac nowa liczbe" << endl;
  14.         cout << "2. Wyswietlic w systemie dziesietnym" << endl;
  15.         cout << "3. Wyswietlic w systemie osemkowym" << endl;
  16.         cout << "4. Wyswietlic w systemie szesnastkowym" << endl;
  17.         cout << "5. Juz nic nie chcesz" << endl;
  18.         cin >> menu;
  19.         switch(menu)
  20.              {
  21.                 case 1: cin >> setbase(0) >> liczba;  break;
  22.                 case 2: cout << showbase << dec << liczba << endl; break;
  23.                 case 3: cout << showbase << oct << liczba << endl; break;
  24.                 case 4: cout << showbase << hex << liczba << endl; break;
  25.                 case 5: cout << " Zakonczyles program";  break;
  26.                 default : cout <<" Zly numer, sprobuj jeszcze raz" << endl;
  27.             }
  28.  
  29.         }
  30.         while (menu != 5);
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement