Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int liczba;
- cin >> liczba;
- string wynik;
- while(liczba){
- wynik = (liczba%2?"1 \n":"0 \n") + wynik;
- liczba /= 2;
- }
- string wypisz = string ( wynik.rbegin(), wynik.rend() );
- cout << wypisz;
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement