Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x,y;
- int z = 0;
- cout << "Podaj liczbe w systemie dziesietnym:" << endl;
- cin >> x;
- while (x>0)
- {
- z++;
- int h = z-1;
- y = x%2;
- x = x/2;
- int tab[z];
- tab[h] = y;
- if (x==0)
- {
- for (int i=0; i<z; i++)
- {
- cout << tab[h--];
- }
- }
- }
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement