chillurbrain

7. Математика спешит на помощь.

May 21st, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. import java.util.*;
  2. public class Main{
  3.   public static void main(String[] args) {
  4.     Scanner sc = new Scanner(System.in);
  5.     String[] s = sc.next().split("\\+");
  6.     Arrays.sort(s);
  7.     for(int i =0 ; i < s.length; i++) {
  8.       if(i == (s.length-1)) {
  9.         System.out.print(s[i]);
  10.       } else System.out.print(s[i] + "+");
  11.     }
  12.   }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment