坐标CQ,考号CQ-00228
这是我第一题的源代码
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int main(){
freopen("power.in","r",stdin);
freopen("power.out","w",stdout);
int n;
scanf("%d",&n);
if(n%2){
printf("-1");
}
else{
int k;
while(n>1){
k=log(n)/log(2);
n-=(1<<k);
printf("%d ",(1<<k));
}
}
return 0;
}
各大OJ能AC(luogu,牛客)
想问一下这上面的代码是哪个地方在某一些特定的机器上不对吗?