Description
给你n个整数,请按从小到大的顺序输出

Input
第一行数字n,表示有多少个整数(n<=1000000)

随后有n个数字输入

Output
排序后结果,每个数字用空格隔

展开全部
收起
3回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • 李斯年

    18人对此回答表示赞同

    请参考如下代码:
    先定义一个数组,输入的数据循环调用如下函数就可以按顺序排序,然后输出就可以了:
    int Insert(int nArray,int nCount,int nValue)
    {
    int nLoop;
    for(nLoop=0;nLoop<nCount;nLoop++)
    {
    if(nArray[nLoop]<nValue)continue;
    else
    展开
    18
    0回复
    发布于 6年前

    评论(0)

    收起评论

  • 楚云潇雨

    11人对此回答表示赞同

    #include <iostream>
    using namespace std;
    void main()
    {
    int n,i,j;
    int *a;
    cin>>n;
    a=new int[n];
    for(i=0;i<n;i++) cin>>a[i];
    for(i=0;i<n-1;i++)
    for(j=0;j<n-i-1;j++)
    if(a[j]&g
    展开
    11
    0回复
    发布于 6年前

    评论(0)

    收起评论

  • Kat王淑仪

    4人对此回答表示赞同

    #include <stdio.h>
    #define SIZE 1000010
    /* 快速排序 */
    void QuickSort(int a[], int left, int right)
    {
    int i=left, j=right, key = a[left];

    while(i<j) {
    while(i<j && a[j] >= key) j--;
    展开
    4
    0回复
    发布于 6年前

    评论(0)

    收起评论

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部