import java.util.Scanner;

public class ForLoops {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		// for loops
		// 1. start
		// 2. condition
		// 3. next
		// 4. repeat
		
		// for (start; condition; next) {
		//   repeat
		// }
		
		for(int count = 0; count < 10; count++ ) {
			System.out.println(count);
		}
		//can't do this
		//System.out.println(count);
		
		int count;
		for(count = 0; count < 10; count++ ) {
			System.out.println(count);
			//count *= 2;  /you can change count in the loop
		}
		System.out.println(count);
		
		System.out.print("How many times to repeat? ");
		int value = input.nextInt();
		
		//table header
		System.out.printf("%10s |%10s |%10s |%10s\n", "i", "i^2", "i^3", "2^i");
		
		for(int i = 1; i <= 46; i++) {
			System.out.print("-");
		}
		System.out.println();
		
		for(int i = 1; i <= value; i++) {
			System.out.printf("%10d |%10d |%10d |%10.0f\n", i, i*i, i*i*i, Math.pow(2,i));
		}
	}

}
