Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
56954 zhangweiran 二进制分类 C++ Wrong Answer 0 MS 232 KB 311 2024-11-17 17:03:40

Tests(0/1):


#include <iostream> using namespace std; int main(){ long a; while(cin>>a){ long i=0,n=0,m=a; //for循环计数有多少个1和多少个0 for(;m>0;m/=2){ if(m%2==0){ n++; }else{ i++; } } if(i>n){ cout<<"A\n"; }else{ cout<<"B\n"; } } return 0; }


Judgement Protocol: