{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "ca3dd3d533904c13b864ed2bd73dbbe2",
  "keywords": "桶排序,算法初阶,线性时间排序,排序和顺序统计量",
  "title": "指针排序问题",
  "desc": [
    {
      "content": "\n<p>输入10个数&#xff0c;按绝对值从大到小排序输出。\n输入形式&#xff1a;输入10个float实数\n输出形式&#xff1a;保留小数点后两位有效数字；输出从大到小排列\n</p>",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "cpp"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ]
  ],
  "template": {
    "content": "#include <math.h>\n#include <stdio.h>\nvoid paixu(float *p,int n)\n{\n\tint i,j;\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 (fabs(p[j])<fabs(p[j + 1])) \n\t\t\t{ \n\t\t\t\tfloat tmp; \n\t\t\t\ttmp = p[j]; \n\t\t\t\tp[j] = p[j + 1];\n\t\t\t\tp[j + 1] = tmp;\n\t\t\t}\n\t\t}\n\t}\n}\nint main()\n{\n\tfloat f[10];\n\tint i;\n\tfor(i=0;i<10;i++)\n\t\tscanf(\"%f\",&f[i]);\n\tpaixu(f,10);\n\tfor(i=0;i<10;i++)\n\t\tprintf(\"%.2f \",f[i]);\n\treturn 0;\n}",
    "language": "cpp"
  },
  "node_id": "dailycode-c03b1ceef1b24852b191ba1208ae6903",
  "license": "csdn.net",
  "created_at": 1637894159,
  "topic_link": "https://bbs.csdn.net/topics/600470144"
}