青椒DALAO
查看原帖
青椒DALAO
885777
_cheems_ckr_楼主2024/8/18 21:53
#include<bits/stdc++.h>
using namespace std;
int n,a[10000001];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	if(n&1) cout<<"-1";
	else{
		int i=1;
		while(n){
			n-=pow(2,i);
			cout<<pow(2,i)<<' ';
			i++;
		}
	}
	return 0;
}

怎么把输出倒过来啊?我是魔芋粉

2024/8/18 21:53
加载中...