文章
21
粉丝
76
获赞
1
访问
13.2k
#include"stdio.h"
#include"string.h"
int main(void){
int ans;
long long int n;
char s[105];
while(scanf("%lld",&n) != EOF){
ans = 0;
int cnt =0;
while(n>0){
long long int w = n%2;
s[cnt++] = w + '0';
n = n/2;
}
for(int i = 0;i<cnt;i++){
if(s[i] == '0'){
ans = ans *2;
} else{
&...
登录后发布评论
对,要用数组,long long存不下