Advertisement
rengetsu

ProcedurProgramavimas_3.03

Apr 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <bitset>
  3. #include <string>
  4. using namespace std;
  5.  
  6. void DecToBin(int a)
  7. {
  8.     if (a / 2 != 0) {
  9.         DecToBin(a / 2);
  10.     }
  11.     printf("%d", a % 2);
  12. }
  13.  
  14. int main()
  15. {
  16.     int a;
  17.     cin>>a;
  18.     DecToBin(a);
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement