Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
128605 林嘉乐 二进制转十进制 C++ Compile Error 0 MS 0 KB 353 2025-08-18 16:23:12

Tests(0/0):


Code:

#include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int s=0; char a[64]; cin>>a; int l=strlen(a); for(int i=0,j=l-1;i<l&&j>=0;i++,j--){ s+=(a[j]-'0')*pow(2,i); } cout<<s; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:5: error: 'cin' was not declared in this scope
     cin>>a;
     ^
Main.cc:14:5: error: 'cout' was not declared in this scope
     cout<