| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 68671 | 祝家懿 | 31回文字符串 | C++ | Runtime Error | 1 MS | 268 KB | 526 | 2024-03-24 12:12:44 |
#include<bits/stdc++.h> using namespace std; int main() { string a,j,l; cin>>a; int n; int o=0; n=a.size(); if(n%2==0){ for(int i=0;i<=n/2;i++){ j[i]=a[i]; } for(int i=n;i<=(n-1)/2;i--){ l[o]=a[i]; o++; } } else{ for(int i=0;i<=(n-1)/2;i++){ j[i]=a[i]; } for(int i=n;i<=(n-1)/2;i--){ l[o]=a[i]; o++; } } int x; x=j.size(); for(int i=0;i<=x;i++){ if(j[i]==l[i]){ } else{ cout<<"No"; return 0; } } cout<<"Yes"; return 0; }
Runtime Error:Segmentation fault