#include <bits/stdc++.h> using namespace std; int binary(int n) { int i=0; int k=0; while (n!=0) { k=k+(n%2)*pow(10,i); n=n/2; i++; } return k; } int main() { int n; cout<<"十进制:"; cin>>n; cout<<"二进制:"<<binary(n)<<endl; return 0; }