Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
99917 任斌 二进制转十进制 C++ Runtime Error 0 MS 276 KB 240 2024-12-01 10:52:00

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); int p=1; for(int i=0,j=len-1;i<len&&j>=0;i++,j--){ b+=p*(a[j]-'0'); p*=2; } cout<<b; return 0; }


Run Info:

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