Advertisement
Uncleeee

Untitled

Apr 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void TenTwo(int n){
  6. if (n >= 2)
  7. TenTwo(n/2);
  8. cout << n%2;
  9. }
  10.  
  11. int main()
  12. {
  13. setlocale(LC_ALL,"rus");
  14. int n;
  15. cout << "введите n" << endl;
  16. cin >> n;
  17. cout << "Число " << n << " в двоичной сс: ";
  18. TenTwo(n);
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement