Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
137482 郝王骏程 二进制小数转十进制 C++ Compile Error 0 MS 0 KB 498 2025-11-17 20:40:00

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ char a[64]; double s=0,x=2; int e=a.find()-1; cin>>a; for(int i=e;i>=0;i--){ s+=(a[i]-'0')*pow(2,i) } for(int i=e+2;i>=0;i--){ s+=(a[i]-'0')*pow(5,i) } cout<<s; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:13: error: request for member 'find' in 'a', which is of non-class type 'char [64]'
     int e=a.find()-1;
             ^
Main.cc:14:6: error: expected ';' before '}' token
      }
      ^
Main.cc:17:6: error: expected ';' before '}' token
      }
      ^
Main.cc:9:16: warning: unused variable 'x' [-Wunused-variable]
     double s=0,x=2;
                ^