Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
99894 任斌 二进制转十进制 C++ Runtime Error 0 MS 284 KB 226 2024-12-01 09:34:21

Tests(0/20):


Code:

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


Run Info:

*** stack smashing detected ***: ./Main terminated