{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "e2f076d8948c4d889c4350d98a9aa7cd",
  "keywords": "算法初阶,基础知识,算法基础,设计算法,分析分治算法",
  "title": "对数组中所有的数据按照输入先后顺序进行显示输出",
  "desc": [
    {
      "content": "\n<p>定义整数数组x&#xff0c;用键盘向数组输入10个数&#xff0c;输入之后&#xff0c;对数组中所有的数据按照输入先后顺序进行显示输出&#xff0c;最后设计一种算法&#xff0c;对数组中的数据进行升序排序&#xff0c;并输出排序后的数</p>",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "cpp"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ]
  ],
  "template": {
    "content": "#include <stdio.h>\nvoid Sortfun(double a[],int n)\n{\n\tint i,j;\n\tdouble tmp;\n\tfor (i=0;i<n-1;i++)\n\t{\n\t\tfor (j=0;j<n-1-i;j++)\n\t\t{\n\t\t\tif (a[j] > a[j+1])\n\t\t\t{\n\t\t\t\ttmp = a[j];\n\t\t\t\ta[j] = a[j+1];\n\t\t\t\ta[j+1]= tmp;\n\t\t\t}\n\t\t}\n\t}\n}\nint main()\n{\n\tint i;\n\tdouble a[10];\n\tprintf(\"请输入10个数:\");\n\tfor(i =0;i<10;i++)\n\t\tscanf(\"%lf\",&a[i]);\n\tprintf(\"原顺序:\\n\");\n\tfor(i=0;i<10;i++)\n\t\tprintf(\"%g \",a[i]);\n\tprintf(\"\\n\");\n\tSortfun(a,10);\n\tprintf(\"排序后:\\n\");\n\tfor(i=0;i<10;i++)\n\t\tprintf(\"%g \",a[i]);\n\tprintf(\"\\n\");\n\treturn 0;\n}",
    "language": "cpp"
  },
  "node_id": "dailycode-c2ecfa9c0205486dbee24ece017d6df8",
  "license": "csdn.net",
  "created_at": 1637894160,
  "topic_link": "https://bbs.csdn.net/topics/600470244"
}