Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
121287 陈骏睿 字符串拼接 C++ Compile Error 0 MS 0 KB 452 2025-06-07 10:56:37

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(){ int a[1000],b[1000]; int n; cin>>a[1000] cin>>b[1000]; cin>>n; int s=strlen(a); int c=strlen(b); if(n<=s){ cout<<a[n-1]; }else{ cout<<b[n-s-1]; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:11:2: error: expected ';' before 'cin'
  cin>>b[1000];
  ^
Main.cc:13:16: error: cannot convert 'int*' to 'const char*' for argument '1' to 'size_t strlen(const char*)'
  int s=strlen(a);
                ^
Main.cc:14:17: error: cannot convert 'int*' to 'const char*' for argument '1' to 'size_t strlen(const char*)'
   int c=strlen(b);
                 ^
Main.cc:14:7: warning: unused variable 'c' [-Wunused-variable]
   int c=strlen(b);
       ^