题解
2026-02-07 17:00:54
发布于:黑龙江
31阅读
0回复
0点赞
废话不多说直接上代码:
#include <bits/stdc++.h>
using namespace std;
bool check(int x){
for(int i = 0; pow(2,i) <= x; i++){
for(int j = 0; pow(2,j) <= x; j++){
if(pow(2,i) + pow(2,j) == x){
return true;
}
}
}
return false;
}
int main(){
int l,r;
cin >> l >> r;
int ans = 0;
for(int i = l; i <= r; i++){
if(check(i)){
ans++;
}
}
cout << ans;
return 0;
}
麻烦点个赞或给个关注吧!(必互关)!!!
这里空空如也


有帮助,赞一个