解题思路:
注意事项:
参考代码:
#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
int a;
while(scanf("%d",&a) == 1){
int *p=new int [a];
for(int j=0;j<a;j++){
scanf("%d",p+j);
}
sort(p,p+a,greater<int>());
for(int i=0;i<a;i++){
printf("%d ",*(p+i));
}
printf("\n");
}
return 0;
}
0.0分
2 人评分
C二级辅导-温度转换 (C语言代码)浏览:2240 |
C语言考试练习题_保留字母 (C语言代码)浏览:681 |
C语言训练-计算一个整数N的阶乘 (C语言代码)浏览:920 |
【绝对值排序】 (C++代码)浏览:669 |
WU-陶陶摘苹果2 (C++代码)浏览:965 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:608 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:632 |
1126题解浏览:577 |
2006年春浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:661 |
字符逆序 (C语言代码)浏览:612 |