import java.util.Scanner;

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

		printSeason();	
	
		String longer = longerString("Hello", "Bye");
		System.out.println("longer string: " + longer);

		Scanner kb = new Scanner(System.in);
		System.out.println("Please enter an integer");
		int input = kb.nextInt();
		boolean result = isOdd(input);
		System.out.println("Is odd: " + result);

		int[][] m1 = {{2,4,6,4},{5,7,8,9}};
		int numRows = numRows(m1);
		System.out.println("Number of rows: " + numRows);

		boolean sameLengths = sameRowLengths(m1);
		System.out.println("Same row lengths: " + sameLengths);

		int[][] m2 = {{2,4,5,6},{1}};
		sameLengths = sameRowLengths(m2);
		System.out.println("Same row lengths: " + sameLengths);

	} // end of main

	static boolean sameRowLengths(int[][] m) {
		int firstRowLength = m[0].length;
		for(int i = 1; i < m.length; i++) {
			if (m[i].length != firstRowLength) {
				return false;
			}
		}
		return true;
	}

	static int numRows(int[][] m) {
		return m.length;
	}

	static void printSeason() {
		System.out.println("Fall");
	}

	static boolean isOdd(int x) {
		/*
		boolean result = false;
		if (x % 2 == 1) {
			result = true;
		}
		return result;		
		*/

		return (x % 2 == 1);
	}

	static String longerString(String s1, String s2) {
		/*
		String result = s1;
		if (s2.length() > s1.length()) {
			result = s2;
		}
		return result;	
		*/
		return (s1.length() > s2.length()) ? s1 : s2;
	}	

} // end of class
