题目1192:回文字符串--------自从用了char*后,感觉好多题都简单了

#include<stdio.h>
#include<stdlib.h>
#include<cstring>
int main()
{
    char *str=(char *)malloc(sizeof(char));
    while(scanf("%s",str)!=EOF)
    {
        int len,i;
        len=strlen(str);
        bool flag=true;
        for (i=0;i<len;i++)
         if (str[i]!=str[len-1-i])
            flag=false;
        if (flag) printf("Yes!
");
        else printf("No!
"); 
    }
    return 0;
}
原文地址:https://www.cnblogs.com/jianrenguo/p/6509920.html