Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
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
|
|||||||
2022-03-31 05:21:52
Buynad zvrkhhhhh <2+1 |
|||||||
2022-01-31 16:42:10
import java.util.*; import java.lang.*; import java.util.Scanner; public class Main { public static void main (String[] args){ try(Scanner scanner = new Scanner(System.in)){ long a =scanner.nextLong(); long j=a; long w =1; while (j>=10) { j/=10; w++; } long[] b=new long[w]; long[] max= new long [w]; for (int i=0;i<10;i++) { b[i]= (a%10); a/=10; }int y=0; for (int k=9;k>0;k--) { for (int k1=0;k1<b.length;k1++) { if (b[k1]==k) { max[y]=b[k1]; y++; } }} for (int p=0;p<max.length;p++) { System.out.print(max[p]); } } } } miniih yagaad buruu baigaad baigaan bol |
|||||||
2022-01-28 08:13:09
#include<bits/stdc++.h> #include<math.h> using namespace std; int main(){ long long a,b=0,c1,c2,c3,d,max=0,n=0; cin>>a; c3=a; while(a>b){ c1=c3-(max*(pow(10,n-1))); c2=c1; c3=c1; max=0; while(c1>0){ d=c1%10; if(d>max){ max=d; } c1=c1/10; } n=0; while(c2>0){ d=c2%10; n++; if(d==max){ break; } c2=c2/10; } b=b*10+max; } cout<<b; return 0; } <3 |
|||||||
2020-11-08 03:30:17
Бие хүний сэтгэл судлал нь хүн юугаараа бусдаас ялгаатай байгааг, сэтгэл хөдлөл, мэдрэмж, бодол санаа хэрхэн хувь хүний онцлогийг бүтээдэг тухай судалдаг сэтгэл судлалын ухагдахуун юм. Бие хүний сэтгэл судлалыг зарим талаараа зан чанар/зан авир судлал гэж нэрлэж ч болох юм. Зан чанар гэж юу вэ ? Бид зан чанарын тухай ярихдаа заавал тайлбарлах шаардлагагүй байдаг. … |
|||||||
2020-11-08 03:00:09
|
|||||||
2020-11-08 02:54:17
<!DOCTYPE html> <!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--> <!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]--> <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--><html class="not-ie" lang="en"> <!--<![endif]--> <head> <!-- contest header --> <meta charset="utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" id="metatag"> <title>АЛГОРИТМЫН ЦАГААН ТОЛГОЙ (SPOJ) - Problems</title> <meta name="keywords" content="programming, language, algorithm, spoj, contest, contester, Java, C#, Pascal, C, C++, python, ruby, caml, ocaml, perl, haskell, lisp, prolog, fortran, assembler, asembler, functional, online, judge, problem, problemset, ACM"> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta property="og:image" content="//stx1.spoj.com/gfx/spoj-fb.jpg"/> <meta property="og:description" content="SPOJ (Sphere Online Judge) is an online judge system with over 315,000 registered users and over 20000 problems. The solution to problems can be submitted in over 60 languages including C, C++, Java, Python, C#, Go, Haskell, Ocaml, and F#. SPOJ has a rapidly growing problem set/tasks available for practice 24 hours/day, including many original tasks prepared by the community of expert problem setters associated with the project."/> <meta name="description" content="SPOJ (Sphere Online Judge) is an online judge system with over 315,000 registered users and over 20000 problems. The solution to problems can be submitted in over 60 languages including C, C++, Java, Python, C#, Go, Haskell, Ocaml, and F#. SPOJ has a rapidly growing problem set/tasks available for practice 24 hours/day, including many original tasks prepared by the community of expert problem setters associated with the project."/> <meta property="og:site_name" content="spoj.com"/> <!-- Favicon --> <link href="//stx1.spoj.com/gfx/favicon_new.png" rel="shortcut icon" type="image/x-icon" /> <!-- RSS --> <link href="/RGB7/rss/" rel="alternate" type="application/rss+xml" title="RSS Feed" /> <!-- Web Fonts --> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel="stylesheet" type="text/css"> <!-- CSS: Bootstrap, Font-awesome, Bootstrap libs, --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"> |
|||||||
2020-11-08 02:51:58
<!DOCTYPE html> <!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--> <!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]--> <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--><html class="not-ie" lang="en"> <!--<![endif]--> <head> <!-- contest header --> <meta charset="utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" id="metatag"> <title>АЛГОРИТМЫН ЦАГААН ТОЛГОЙ (SPOJ) - Problems</title> <meta name="keywords" content="programming, language, algorithm, spoj, contest, contester, Java, C#, Pascal, C, C++, python, ruby, caml, ocaml, perl, haskell, lisp, prolog, fortran, assembler, asembler, functional, online, judge, problem, problemset, ACM"> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta property="og:image" content="//stx1.spoj.com/gfx/spoj-fb.jpg"/> <meta property="og:description" content="SPOJ (Sphere Online Judge) is an online judge system with over 315,000 registered users and over 20000 problems. The solution to problems can be submitted in over 60 languages including C, C++, Java, Python, C#, Go, Haskell, Ocaml, and F#. SPOJ has a rapidly growing problem set/tasks available for practice 24 hours/day, including many original tasks prepared by the community of expert problem setters associated with the project."/> <meta name="description" content="SPOJ (Sphere Online Judge) is an online judge system with over 315,000 registered users and over 20000 problems. The solution to problems can be submitted in over 60 languages including C, C++, Java, Python, C#, Go, Haskell, Ocaml, and F#. SPOJ has a rapidly growing problem set/tasks available for practice 24 hours/day, including many original tasks prepared by the community of expert problem setters associated with the project."/> <meta property="og:site_name" content="spoj.com"/> <!-- Favicon --> <link href="//stx1.spoj.com/gfx/favicon_new.png" rel="shortcut icon" type="image/x-icon" /> <!-- RSS --> <link href="/RGB7/rss/" rel="alternate" type="application/rss+xml" title="RSS Feed" /> <!-- Web Fonts --> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel="stylesheet" type="text/css"> <!-- CSS: Bootstrap, Font-awesome, Bootstrap libs, --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"> |
|||||||
2020-05-15 13:39:09
kra |
|||||||
2020-02-04 09:58:54
#include <iostream> using namespace std; int main() { long long a[100][100],b[100][100],j = 1,n,c,u = 0; scanf("%lld",&n); c = n; while (n >= 1) { c = n % 10; a[0][j] = c; n = n / 10; j++; } int jj = j; int ii = 1; for (ii = 1; ii <= jj; ii++) { u = 0; for (j = 1; j <= jj; j++) { if (a[0][j] >= u) { u = a[0][j]; } } for (j = 1; j <= jj; j++) { if (a[0][j] == u) { a[0][j] = 0; j = jj + 1; } } b[0][ii] = u; } for (j = 1; j < jj; j++) { cout << b[0][j]; } |
|||||||
2019-12-28 08:22:43
#include <bits/stdc++.h> using namespace std; int b[20]; int main(){ long long a; cin>>a; int i=0; while(a>0){ b[i]=a%10; a/=10; i++; } sort(b,b+i); for(int j=i-1;j>=0;j--){ cout<<b[j]; } } |