{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "d8b00b5b1ce84bcc8d20180a7372a780",
  "keywords": "算法初阶,最小值和最大值,排序和顺序统计量,中位数和顺序统计量",
  "title": "找最大数和最小数",
  "desc": [
    {
      "content": "\n编写程序，设置正整数n的值，其中n取值为小于等于10的正整数，再继续输入n个整数数值，从n个整数中找出最大数和最小数，并将它们输出。\n输入格式:\nn的数值（取值为1-10整数）\nn个具体整数值\n输出格式：\n最大值\n最小值\n输入样例1：\n4 \n8  3  4  1 \n输出样例1：\n8\n1\n输入样例2：\n5\n-1  6  3  2  0\n输出样例2：\n6\n-1",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "cpp"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ]
  ],
  "template": {
    "content": "#include <iostream>\nusing namespace std;\nint main()\n{\n\tint n;\n\tcin >> n;\n\tint ma, mi, a;\n\tcin >> a;\n\tmi = ma = a;\n\tfor (int i = 1; i < n; i++)\n\t{\n\t\tcin >> a;\n\t\tif (ma < a) ma = a;\n\t\tif (mi > a) mi = a;\n\t}\n\tcout << ma << endl << mi << endl;\n}",
    "language": "cpp"
  },
  "node_id": "dailycode-b0c64306cabb407cab1133d28d2fa2ec",
  "license": "csdn.net",
  "created_at": 1637894160,
  "topic_link": "https://bbs.csdn.net/topics/600470161"
}