优美景点

Description

D城市是个有深厚文化底蕴的城市,有许多优美的景点,今年政府组织了市民对该城市的N个优美的景点进行了投票,政府部门想知道这N个景点投票数从大到小的情况,现在请你对给定的投票数按从大到小排序输出来。

Input

文件共有N+1行,第一行为一个正整数N,表示共有N个景点(1=

Output

共有N行,每行一个正整数,输出按投票数值从大到小排好序的结果。

Sample Input

5
90
105
87
65
98
Sample Output

105
98
90
87
65

.
.
.
.
.
分析
这是一道很有深度的题,它在考你会不会编程(滑稽)

.
.
.
.
.
程序:

#include<iostream> 
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int n,a[1000];

int main()
{
	freopen("landscape.in","r",stdin);
	freopen("landscape.out","w",stdout);
	scanf("%d",&n);
	for (int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	for (int i=n;i>=1;i--)
		printf("%d\n",a[i]);
	fclose(stdin);
	fclose(stdout);
	return 0;
}
posted @ 2019-04-27 08:47  银叶草  阅读(88)  评论(0编辑  收藏  举报
Live2D