Advertisement
Geronimonon

Przeróbka liczb

Oct 16th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <conio.h>
  4. using namespace std;
  5.  
  6. int main ()
  7.  
  8. {
  9.     int w=-1,a;
  10.         system("cls");
  11.         cout<<"Podaj liczbe: ";
  12.         cin>>a;
  13.         cout<<endl<<"Wybierz w jakim systemie ma byc reprezentowana:"<<endl<<"8- osemkowy"<<endl<<"16- szesnastkowy"<<endl<<"0- wyjscie"<<endl;
  14.         cin>>w;
  15.         if (w==8)
  16.             cout<<"Liczba "<<a<<" w systemie osemkowym to "<<oct<<a<<endl;
  17.         if (w==16)
  18.             cout<<"Liczba "<<a<<" w systemie szesnastkowym to "<<hex<<a<<endl;
  19.     return 0;
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement