| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 153348 | 任艺宸 | 二进制转十进制 | C++ | Accepted | 1 MS | 280 KB | 418 | 2026-05-16 11:18:13 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ char a[64]={}; cin>>a; int l=strlen(a),n=0; for(int j=l-1,i=0;i<l&&j>=0;i++,j--){ n+=(a[j]-'0')*pow(2,i); }cout<<n; return 0; }