Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma hdrstop
- #pragma argsused
- #include <tchar.h>
- #include <stdio.h>
- #include <iostream.h>
- #include <conio.h>
- void DecToBin(int);
- int z;
- int main()
- {
- int n;
- cout << "n = ? ";
- cin >> n;
- cout << "z= ?";
- cin >> z;
- cout << n << " (desyatichnaya) = ";
- DecToBin( n );
- cout << " (v sisteme p<9)" << endl;
- getch();
- return 0;
- }
- void DecToBin(int n)
- {
- if ( n >= z ) {
- DecToBin( n/z );
- }
- cout << n % z;
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement