Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7580 - Тооны цифрээс үүсэх их тоо

Өгөгдсөн натурал тооны цифрүүдийн байрыг гарсан тоо нь хамгийн их байхаар солино уу.

Input

Натурал тоо өгөгдөнө. Long long төрөл.

Output

Цифрүүдээр үүсэх хамгийн их тоо.

Example

Input:
1928374

Output:
9874321

Нэмсэн:Bataa
Огноо:2013-02-06
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2024-12-11 07:35:36
zltsgaa
2024-11-22 02:49:44
#include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c,d,e=0;
cin>>a;
long long arr[100000];
while(a>0){
arr[e]=a%10;
a=a/10;
e++;
}
sort(arr,arr+e);
for(int i=e-1;i>=0;i--){
cout<<arr[i];
}
}
2024-06-03 12:48:43
GRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
2023-10-30 09:06:43
huul suguud ursdu sugud
#include <bits/stdc++.h>
using namespace std;

int main()
{
long long a[1000], b,n,j,i,k,t,m;
cin>>n;
i=1;
while(n>0)
{
b=n%10;
a[i]=b;
n=n/10;
i=i+1;
}
for(j=1;j<i;j++){
for(k=j;k<=i;k++){
if(a[j]<a[k])
{
t=a[j];
a[j]=a[k];
a[k]=t;
}
}
}
for(m=1;m<i;m++)
cout << a[m];
return 0;
}


2023-10-30 nmct ku2 hmat olon bailaa
2023-07-03 03:51:58
#include <bits/stdc++.h>

using namespace std;

int main ()
{
vector<char> v;
string s;
cin >> s;
int sz = s.size();
for(int i = 0; i < sz; i++)
{
v.push_back(s[i]);
}
sort(v.begin(), v.end());
reverse(v.begin(), v.end());
for(int i = 0; i < sz; i++)
{
cout << v[i];
}
}
2022-12-12 16:22:17

fudu huul ahaasaa #include <stdio.h>

int main()
{ int n,a[10000],i=1,j,t,b,q,w,p;
scanf("%d",&n);
while(n>0){
w=n%10;
a[i]=w;
n=n/10;
i++;
}
for(q=1;q<i;q++){
for(j=q+1;j<=i;j++){
if(a[q]<a[j]){
t=a[q];
a[q]=a[j];
a[j]=t;
}
}
}
for(p=1;p<i;p++){
printf("%d",a[p]);
}
return 0;
}
2022-12-09 02:29:34
huul2 suguud #include <bits/stdc++.h>
using namespace std;

int main()
{
long long a[1000], b,n,j,i,k,t,m;
cin>>n;
i=1;
while(n>0)
{
b=n%10;
a[i]=b;
n=n/10;
i=i+1;
}
for(j=1;j<i;j++){
for(k=j;k<=i;k++){
if(a[j]<a[k])
{
t=a[j];
a[j]=a[k];
a[k]=t;
}
}
}
for(m=1;m<i;m++)
cout << a[m];
return 0;
}
nmct ku2 in hamt olon
2022-10-25 16:19:16
#include<stdio.h>
#include<algorithm>
using namespace std;
main()
{
long long int a,b,c[100],d,e,j;
scanf("%d",&a);
for(d; a>0; d++){
b=a%10;
c[d]=b;
a/=10;
}
sort(c,c+d);
d--;
e=c[0];
for( j=d; j>0; j--)
e=e*10+c[j];
printf("%d",e);
}
2022-06-26 14:54:12
#include <iostream>
using namespace std;
int b[10];
int main()
{
string a;
cin >> a;
for(int i=0;i<a.size();i++) {
if(a[i]-'0'==0) b[0]++;
if(a[i]-'0'==1) b[1]++;
if(a[i]-'0'==2) b[2]++;
if(a[i]-'0'==3) b[3]++;
if(a[i]-'0'==4) b[4]++;
if(a[i]-'0'==5) b[5]++;
if(a[i]-'0'==6) b[6]++;
if(a[i]-'0'==7) b[7]++;
if(a[i]-'0'==8) b[8]++;
if(a[i]-'0'==9) b[9]++;
}
for(int i=9;i>=0;i--) {
while(b[i]!=0) {
cout << i;
b[i]--;
}
}
}
2022-03-31 06:08:41
a[aragshaa][dooshoo] yvah tusam l galzuu hunii odriin temdeglel shig ym bolood bhi sadd :(((
from; nimontab
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.