判断5个字符串是否为回文并输出回文字符串个数
新人不知道这两个编译错误怎么改#include<iostream>
#include<cstring>
#define N 80
using namespace std;
int judge(char st[N],int a)
{ int len,i;
len=strlen(st);
for (i=0;i<len;i++)
if(st[i]==st[len-1])
{
continue;
return 1;
}
else
{
return 0;
break;
}
int main()
{
int i,a,n;
char st[N];
for (a=0;a<6;a++)
{
cout << "输入第" << a << "个字符串:" << endl;
gets(st);
flag=judge(st,N);
if (flag)
{
cout << "是回文" << endl;
n++;
}
else
cout << "不是回文" << endl;
a++;
}
cout << "有" << n << "个回文字符串" << endl;
return 0;
}