Guest User

Untitled

a guest
Jun 20th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. public class Modlet {
  2.  
  3.     public static void main( String[] args ) {
  4.         int N = args.length;
  5.         int[] dataset = new int[N];
  6.         int[] count = new int[10];
  7.         int xx = 0;
  8.        
  9.         for (int i = 0; i < N; ++i) {
  10.             dataset[i] = Integer.parseInt(args[i]);
  11.             count[i] = 0;
  12.            
  13.            
  14.         }
  15.        
  16.         for (int i = 0; i < N; ++i) {
  17.             for (int j = 0; j < N; ++j) {
  18.                 if (dataset[j] == dataset[i]) ++count[i];
  19.             }
  20.            
  21.            
  22.         }
  23.        
  24.         for (int i = 0; i < 10; ++i) {
  25.             System.out.println("[" + i + "s: " + count[i] + "]");
  26.         }
  27.     }
  28.    
  29. }
Add Comment
Please, Sign In to add comment