Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int dec_i(int liczba,int pod)
- {
- int wynik=0,p=1;
- while(liczba>0)
- {
- wynik=wynik+p*(liczba%pod);
- liczba=liczba/pod;
- p=p*8;
- }
- return wynik;
- }
- int i_dec(int liczba,int pod)
- {
- int wynik=0,p=1;
- while(liczba>0)
- {
- wynik=wynik+p*(liczba%5);
- liczba=liczba/5;
- p=p*pod;
- }
- return wynik;
- }
- int main()
- {
- int a,pod;
- cin>>a;
- cout<<dec_i(i_dec(a,8),5);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement