Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. public class taskOne{
  2. public static void main(String args[]){
  3.  
  4. int previous = Integer.parseInt(args[0]);
  5.  
  6. System.out.print(previous + " ");
  7.  
  8. for(int i = 1 ; i < args.length ; i++){
  9. int next = Integer.parseInt(args[i]);
  10.  
  11. if(next != previous){
  12. previous = next;
  13. System.out.print(previous + " ");
  14. }
  15.  
  16. }
  17.  
  18.  
  19.  
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement