chillurbrain

Task6Lab6_3

Dec 14th, 2015
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. class Task6_6_3 {
  4.     public static void main(String[] args) {
  5.         Scanner sc = new Scanner(System.in);
  6.         List<Integer> ints = new ArrayList<Integer>();
  7.         int count = sc.nextInt();
  8.         while (count != 0) {
  9.             ints.add(count);
  10.             count = sc.nextInt();
  11.         }
  12.         for (int i = 1; i <= 9; i++) {
  13.             int step = 0;
  14.             for (int j = 0; j < ints.size(); j++) {
  15.                 if (ints.get(j) == i)
  16.                     step++;
  17.             }
  18.             System.out.print(step + " ");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment