Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws FileNotFoundException {
- int count = 400;
- int[] year = new int[count];
- int[] temperature = new int[count];
- int i = 0;
- Scanner input = new Scanner(new File("data.txt"));
- while(input.hasNextInt())
- {
- String line = input.nextLine();
- String[] items = line.split(" ");
- year[i] = Integer.valueOf(items[0]);
- temperature[i] = Integer.valueOf(items[1]);
- i++;
- }
- for(i=0; i < year.length; i++){
- System.out.println("(" + year[i]+ ", " + temperature[i] + ")");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement