编辑代码

#include<iostream>
using namespace std;
bool f2(const char* str,int strlen)
{
	bool out=true;
	if(strlen<=1)
	return true;
	for(int i=0;i<strlen/2;i++){
	if(str[i]!=str[strlen-1-i]){
	
	out=false;
	break;}}
	return out;
	
 } 
 int main(){
   char str[]="abccba";
   int strlen=6;
   if(f2(str,strlen))
   {
   cout<<"是回文"; 
    }
   else 
   {
cout<<"不是回文"; }
  
 }