Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int main() {
- int liczba;
- cout << "Podaj liczbę do konwersji" << endl;
- cin >> liczba;
- string wynik;
- while(liczba){
- wynik = (liczba%2?"1":"0") + wynik;
- liczba /= 2;
- }
- cout << "Wynik po konwersji: " << wynik << endl;
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement