首页 > 试题广场 >

排序(冒泡排序)

[编程题]排序(冒泡排序)
  • 热度指数:9001 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 256M,其他语言512M
  • 算法知识视频讲解
给你一个n代表有n个数字,给出这n个数字,然后你需要使用冒泡排序将这些数字从小到大排好。

输入描述:
第一行输入一个n,代表有n个数字
第二行输入n个数


输出描述:
输出排序好后的n个数
示例1

输入

4
4 3 2 1

输出

1 2 3 4
头像 change_able
发表于 2021-03-19 19:00:16
include <stdio.h> include <stdlib.h> void swap(int a[],int x,int y) { int temp; temp = a[x]; a[x] = a[y]; a[y] = temp;}void 展开全文