Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
162384 李昱龙 二进制转十进制 C++ Accepted 2 MS 280 KB 212 2026-10-17 14:25:14

Tests(20/20):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int len=s.size(); int a=0,b=len-1; for(int i=0;i<len;i++){ a=a+pow(2,b)*(s[i]-'0'); b--; } cout<<a; return 0; }