Guest User

Untitled

a guest
Apr 26th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class ArrayFilter {
  4. public static void main(String[]args){
  5.  
  6. String data [] = new String [1000];
  7. int i = 0;
  8. int Schranke;
  9. Scanner konsole = new Scanner(System.in);
  10.  
  11. Schranke = konsole.nextInt();
  12.  
  13. while(konsole.hasNext()){
  14. data[i] = konsole.nextLine();
  15. i++;
  16. }
  17.  
  18.  
  19. System.out.println(Schranke);
  20.  
  21. for (int j = 0; j < i ;j++){
  22. if (data[j].length() <= Schranke){
  23. System.out.println(data[j]);
  24. }
  25. else{
  26. data[j] = data[j+1];
  27. i = i - 1;
  28. }
  29. }
  30. konsole.close();
  31. }
  32. }
Add Comment
Please, Sign In to add comment