solution.json 1.6 KB
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "ce51c2a42ff44e23a4ff61e60774103f",
  "keywords": "算法高阶,字符串匹配,算法问题选编,利用有限自动机进行字符串匹配",
  "title": "回文串",
  "desc": [
    {
      "content": "\n题目描述\n回文串是从左到右或者从右到左读起来都一样的字符串,试编程判别一个字符串是否为回文串。\n输入\n输入一个字符串。串长度<255.\n输出\n判别输入的字符串是否为回文串,是回文串输出\"Y\",否则输出\"N\"\n样例输入\nabcba\n样例输出\nY",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "cpp"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ]
  ],
  "template": {
    "content": "#include<iostream>\n#include<string.h>\nusing namespace std;\nint main(void)\n{\n\tchar *p=\"abcba\";\n\tint n=strlen(p);\n\tbool flag=1;\n\tint i;\n\tfor(i=0;i<n/2;i++)\n\t{\n\t\tcout<<p[i]<<\"\\t\"<<p[n-1-i]<<endl;\n\t\tif(p[i]!=p[n-1-i])\n\t\t{\n\t\t\tflag=0;\n\t\t\tcout<<\"N\"<<endl;break;\n\t\t}\n\t}\n\tif(flag==1)\n\t\tcout<<\"Y\"<<endl;\n\treturn 0;\n}",
    "language": "cpp"
  },
  "node_id": "dailycode-6aef4822e3c54d95b4bb480d4242e5f1",
  "license": "csdn.net",
  "created_at": 1637894160,
  "topic_link": "https://bbs.csdn.net/topics/600469941"
}