1 solutions
-
0
C++ :
#include<cstdio> #include<cmath> #include<algorithm> using namespace std; bool com(int x,int y) { return abs(x)>abs(y); } int main() { int n,i,a[101]; while(~scanf("%d",&n)&&n) { for(i=0;i<n;i++) scanf("%d",&a[i]); sort(a,a+n,com); for(i=0;i<n;i++) { if(i==0) printf("%d",a[0]); else printf(" %d",a[i]); } printf("\n"); } return 0; }
- 1
Information
- ID
- 18116
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By