解题思路:
注意事项:
参考代码:
#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语言程序设计教程(第三版)课后习题12.5 (C语言代码)浏览:762 |
【出圈】 (C语言代码)浏览:537 |
简单的a+b (C语言代码)浏览:645 |
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:486 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:544 |
【简单计算】 (C语言代码)浏览:605 |
【明明的随机数】 (C语言代码)浏览:753 |
关于C语言变量位置的问题浏览:261 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:593 |
C二级辅导-公约公倍 (C语言代码)浏览:471 |