#include<bits/stdc++.h>
using namespace std;
const int N=500;
int a[N];
int ask(int x){
int ans=0;
for(;x;x-=x&-x)ans+=a[x],x-=x&-x;
return ans;
}
void add(int x,int y){
for(int i=x;i<=N;i+=x&-x)a[i]+=y;
}
int main(){
int x=15;
while(x){
printf("%d %d\n",x-(x&-x)+1,x);
x-=x&-x;
}
}
原文:https://www.cnblogs.com/codjjj/p/15213884.html