Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- void step(int n){
- if (n>0){
- step(n/2);
- cout<<(n%2);
- }
- }
- int main() {
- int n;
- setlocale(LC_ALL, "Russian");
- cout<<"Введите число";
- cin>>n;
- cout<<"двоичная запись числа=";
- step(n);
- return 0;
- }
Add Comment
Please, Sign In to add comment