#include<iostream> #include <math.h> #include<algorithm> using namespace std; int main() { int n; cin>>n; int res; int temp; int m; int i=0; double p; res=log(n+3+1)/log(2); temp=pow(2,res); m=n+3-(temp-1); p=m/pow(2,res-2); if(p==0) cout<<"D"; if(p>0&&p<=1) cout<<"A"; if(p>1&&p<=2) cout<<"B"; if(p>2&&p<=3) cout<<"C"; if(p>3&&p<=4) cout<<"D";
拼多多第一题
最新推荐文章于 2024-09-09 12:22:49 发布