Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
99899 | 任斌 | 二进制转十进制 | C++ | Runtime Error | 1 MS | 276 KB | 230 | 2024-12-01 10:23:56 |
#include<bits/stdc++.h> using namespace std; int main() { int b=0; char a[20]; cin>>a; int len=strlen(a),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; }
*** stack smashing detected ***: ./Main terminated