mirror of
https://github.com/m1ngsama/code4sk.git
synced 2025-12-25 02:56:17 +00:00
43 lines
554 B
C++
43 lines
554 B
C++
/*
|
|
7-7 ???????
|
|
?? 10
|
|
?? ??
|
|
?? ???????
|
|
????
|
|
??????????????????????(???????,?????????????,??????)
|
|
????:
|
|
???????,??????????,?????2?30??1073741824,?????????????
|
|
????:
|
|
??????????????,????????????
|
|
????:
|
|
25 36 0 1
|
|
1024 1073741824
|
|
????:
|
|
11001
|
|
100100
|
|
0
|
|
1
|
|
10000000000
|
|
1000000000000000000000000000000
|
|
*/
|
|
#include<stdio.h>
|
|
int main(){
|
|
int n;
|
|
int b[10000];
|
|
while(scanf("%d",&n)==1){
|
|
int i,cnt=0;
|
|
if(n==0) printf("0");
|
|
for(i=0;n!=0;n/=2){
|
|
b[i]=n%2;
|
|
cnt++;
|
|
i++;
|
|
}
|
|
for(i=cnt-1;i>=0;i--){
|
|
printf("%d",b[i]);
|
|
}
|
|
printf("\n");
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|