{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "08e20ff0063245f98a1255e995fd9d4f",
  "keywords": "动态表,表扩张,算法中阶,摊还分析,高级设计和分析技术",
  "title": "从键盘输入一组数据建立单链表，然后输出奇数位上的元素。",
  "desc": [
    {
      "content": "\n输入\n第一行输入单链表长度n。\n第二行输入字符串。\n输出\n第一行：输出各奇数位元素\n样例输入\n7\nABCDEFG\n样例输出\nACEG",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "cpp"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ]
  ],
  "template": {
    "content": "#include \"stdio.h\"\n#include \"stdlib.h\"\ntypedef struct node\n{\n\tchar x;\n\tnode * next;\n} LList;\nint main()\n{\n\tLList * header = NULL;\n\tnode * p;\n\tint n;\n\tscanf(\"%d\", &n);\n\tfflush(stdin);\n\tfor (int i = 0; i < n; i++)\n\t{\n\t\tif (!header) \n\t\t{\n\t\t\theader = (node *)malloc(sizeof(node));\n\t\t\tp = header;\n\t\t\tscanf(\"%c\", &(header->x));\n\t\t\theader->next = NULL;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tp->next = (node *)malloc(sizeof(node));\n\t\t\tp = p->next;\n\t\t\tscanf(\"%c\", &(p->x));\n\t\t\tp->next = NULL;\n\t\t}\n\t}\n\tp = header;\n\tint i = 0;\n\twhile (p)\n\t{\n\t\tif (i++ % 2 == 0)\n\t\t\tprintf(\"%c\", p->x);\n\t\tp = p->next;\n\t}\n\treturn 0;\n}",
    "language": "cpp"
  },
  "node_id": "dailycode-e4b3395dbb454921b2844885d5edee8b",
  "license": "csdn.net",
  "created_at": 1637894160,
  "topic_link": "https://bbs.csdn.net/topics/600470152"
}