| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 54782 | 石利伟 | 寻找最低数 | C++ | Accepted | 100 | 1 MS | 248 KB | 366 | 2022-07-29 17:12:50 |
#include<bits/stdc++.h> using namespace std; int a; void to2cout(int n){ int num[10]={0},poo=1; for(int i=0;i<=9;i++){ num[i]=n%2; n/=2; } for(int i=0;i<=9;i++){ if(num[i]){ for(int j=0;j<i;j++) poo*=2; break; } } cout<<poo<<endl; } int main(){ for(int i=0;;i++){ cin>>a; if(a==0) break; to2cout(a); } return 0; }