/*
    In preparation for today's quiz I'll
        answer your questions.
*/

import java.util.Scanner;

class Sep16 {
	public static void main(String[] args) {

		Scanner kb = new Scanner(System.in);

		// practice problem set 3 - problem 1
		System.out.println("Please enter 2 integers");
		int input1 = kb.nextInt();
		int input2 = kb.nextInt();

		if (input1 > input2) {
			int temp = input1;
			input1 = input2;
			input2 = temp;
		}

		int i = input1;
		while(i <= input2) {
			System.out.print(i + " ");
			i++;
		}
		System.out.println();
		

		// practice problem set 3 - problem 2
		System.out.println("Please enter 2 integers");
		input1 = kb.nextInt();
		input2 = kb.nextInt();

		if (input1 > input2) {
			int temp = input1;
			input1 = input2;
			input2 = temp;
		}

		i = input1;
		while(i <= input2) {
			if (i % 2 == 0) {
				System.out.print(i + " ");
			}
			i++;
		}
		System.out.println();

		// compute the mean of a sequence of integers
		System.out.println("Please enter a sequence of ints ending in 0");

		int input = kb.nextInt();
		int sum = 0;
		double count = 0; 

		while(input != 0) {
			count++;
			sum = sum + input;	

			input = kb.nextInt();
		}
		double mean = sum / count;
		System.out.println("mean: " + mean);
	


	}
}
