题解 | #排序#

排序

https://www.nowcoder.com/practice/508f66c6c93d4191ab25151066cb50ef

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int main()
{
	int n;
	int arr[101];
	while (scanf("%d", &n) != EOF) {
		for (int i = 0; i < n; ++i)
		{
			scanf("%d", &arr[i]);
		}

		sort(arr, arr + n);

		for (int j = 0; j < n; ++j)
		{
			printf("%d ", arr[j]);
		}

		printf("\n");
	}
	system("pause");
	return EXIT_SUCCESS;
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

用微笑面对困难:只要你保证项目和获奖都是真的就行尤其是“对战,总负责人”啊这些套职,基本上队员,打杂的都这么写
点赞 评论 收藏
分享
哇哇的菜鸡oc:他这不叫校招offer,而是实习offer
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务