Advertisement
Guest User

Untitled

a guest
May 24th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. package KP.acmp.task41;
  2.  
  3. import java.util.Arrays;
  4. import java.util.Scanner;
  5.  
  6. public class Main {
  7.     public static void main(String[] args) {
  8.         int[] temperatures = new int[201];
  9.         Arrays.fill(temperatures, 0);
  10.         Scanner scan = new Scanner(System.in);
  11.         int n = scan.nextInt();
  12.         for (int i = 0; i < n; i++) {
  13.             int t = scan.nextInt();
  14.             temperatures[t + 101]++;
  15.         }
  16.         for (int i = 0; i < temperatures.length; i++) {
  17.             for (int j = 0; j < temperatures[i]; j++) {
  18.                 System.out.println(i - 101 + " ");
  19.             }
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement