Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import chn.util.*;
- public class Lesson19B {
- public static void main(String[] args) {
- FileInput input = new FileInput("compact.txt");
- int[] numbers = new int[100];
- int n=0, size, count;
- while(input.hasMoreTokens()){
- numbers[n] = Integer.parseInt(input.readToken());
- n++;
- }
- size = n;
- count = size;
- for(int x=0; x<count; x++){
- if(numbers[x]==0){
- for(int y=x; y<count; y++){
- numbers[y] = numbers[y+1];
- size--;
- }
- }
- }
- for(int z=0; z<count; z++){
- System.out.println(numbers[z]);
- }
- }
- }
Add Comment
Please, Sign In to add comment