Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long indec(long number) {
- int a;//разряд
- int b = 0;//степень двойки
- int result = 0;//переведенное число
- while (number != 0)
- {
- a = number % 10;//разряд
- number = number / 10;
- if (b == 0)
- b = 1;
- if (b != 0)
- a *= b;
- result += a;
- b *= 5;
- }
- return result;
- }
- void dtp(int n) {
- if (n >= 15)
- dtp(n / 15);
- cout << n % 15;
- }
- int main() {
- long number;
- cout << "\nnumber of pyatirichnaya = ";
- cin >> number;
- cout << "to";
- cout << "\ndec = " << indec(number);
- int n;
- cout << "\nnumber of dec = ";
- cin >> n;
- cout << "to";
- cout << "\npyatnadtsatirichnaya = ";
- dtp(n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement