为啥无法连续判断回文
#include <iostream>using namespace std;
int main()
{
int a,b,c,d,a1,b1,c1,d1;
char ai[100];
char bi[100];
int ci[100];
char di[100];
for(a=0;ai[a]!='\0';a++)
{
cin>>ai[a];
a1++;
}
for(b=0;bi[b]!='\0';b++)
{
cin>>bi[b];
b1++;
}
for(c=0;ci[c]!='\0';c++)
{
cin>>ci[c];
c1++;
}
for(d=0;di[d]!='\0';d++)
{
cin>>di[d];
d1++;
}
if(ai[a++]!=ai[a1--])
{
cout<<"case1: no"<<endl;
}
else
{
cout<<"case1: yes"<<endl;
}
if(bi[b++]!=bi[b1--])
{
cout<<"case1: no"<<endl;
}
else
{
cout<<"case1: yes"<<endl;
}
if(ci[c++]!=ci[c1--])
{
cout<<"case3: no"<<endl;
}
else
{
cout<<"case3: yes"<<endl;
}
if(di[d++]!=di[d1--])
{
cout<<"case4: no"<<endl;
}
else
{
cout<<"csae4: yes"<<endl;
}
return 0;
}