Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1.  
  2.         public Set(int...num) {
  3.         int[] nums = new int[num.length];
  4.         int[] n = new int[num.length];
  5.         int g = 0;
  6.         for(int i = 0; i < num.length;i++)
  7.             nums[i] = num[i];
  8.         for(int i = 0;i < num.length;i++) {
  9.             for(int index = 0;index < num.length;index++) {
  10.                 if(num[i] == num[index]) {
  11.                     System.out.println("1");
  12.                     break;
  13.                 }
  14.                 else {
  15.                     n[g] = num[index];
  16.                     g++;
  17.                     System.out.println(n[g]);
  18.                 }
  19.             }
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement