{
  "question_id": 237869,
  "question_title": "编写程序，输入任意一个含有空格的字符串（至少10个字符），删除指定字符后输出该字符串。",
  "question_content": "编写程序，输入任意一个含有空格的字符串（至少10个字符），删除指定字符后输出该字符串。例如，输入“jiangsu123”和删除位置5，则输出“jiansu123”。",
  "difficulty": "简单",
  "answer_id": 218941,
  "answer_content": "\n\n```\n #include <iostream>\n#include <string>\nusing namespace std;\n\nint main()\n{\n    char s1[100];\n    char s2[100];\n    int n = 0;\n\tcin.getline(s1, 100);\n\tcin.getline(s2, 100);\n    cin >> n;\n\tint i;\n\tint ls2 = strlen(s2);\n\tfor (i = strlen(s1); i >= n; i--)\n\t\ts1[i + ls2] = s1[i];\n\tfor (i = 0; i < ls2; i++)\n\t\ts1[n + i] = s2[i];\n    cout << s1 << endl;\n    return 0;\n}\n```\n\n",
  "tag_name": "c++",
  "cpp": " #include <iostream>\n#include <string>\nusing namespace std;\nint main()\n{\n\tchar s1[100];\n\tchar s2[100];\n\tint n = 0;\n\tcin.getline(s1, 100);\n\tcin.getline(s2, 100);\n\tcin >> n;\n\tint i;\n\tint ls2 = strlen(s2);\n\tfor (i = strlen(s1); i >= n; i--)\n\t\ts1[i + ls2] = s1[i];\n\tfor (i = 0; i < ls2; i++)\n\t\ts1[n + i] = s2[i];\n\tcout << s1 << endl;\n\treturn 0;\n}",
  "topic_link": "https://bbs.csdn.net/topics/600469857",
  "status": 0,
  "keywords": "算法高阶,字符串匹配,算法问题选编,利用有限自动机进行字符串匹配",
  "license": "csdn.net",
  "notebook": {
    "cpp": "https://codechina.csdn.net/csdn/csdn-daily-code/-/jupyter/master/data/notebook/answer/ipynb/cpp/96.ipynb?type=file"
  },
  "author": "yansong588"
}