Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139965 李明秦 二进制转十进制 C++ Accepted 0 MS 296 KB 218 2025-12-13 13:51:18

Tests(20/20):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,sum=0; char a[64]; cin>>a; n=strlen(a); for(int i=n-1,j=0;i>=0,j<n;i--,j++){ sum+=(a[i]-'0')*pow(2,j); } cout<<sum; return 0; }