Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
94981 只因你太美(Ikun 真爱粉) 二进制转R进制 C++ Compile Error 0 MS 0 KB 714 2024-10-26 15:31:41

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; char aaa(int a) { if(a >= 0 && a <= 9) return a + '0'; else return a + 'A' - 10; } int main(){ int bb; char abc[1000]; string a; cin>>a; int m=0,ma=1,mn; for(int i=a.size()-1;i>=0;i--){ if(a[i]=='1'){ m+=ma; } ma*=2; } cin>>mn; if(m==0){cout<<" 0";return 0;} int s=0; while(m){ bb=m%mn; abc[s]=aaa(bb); m/=mn; s++; } for(i = s - 1;i >= 0;i--){ cout<<str[i]; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:34:5: error: 'i' was not declared in this scope
 for(i = s - 1;i >= 0;i--){ 
     ^
Main.cc:35:8: error: 'str' was not declared in this scope
  cout<