/* File: App.java - March 2018 */ package l03; /** * Use various algorithms to test whether the input is a * perfect square. * * Sample usage: java l03.App 534678 * * Each algorithm reports on the number of loops carried out in its * execution. See the lecture notes for more complete descriptions of * the three algorithms. * * @author Michael Albert * */ public class App{ public static void main(String[] args) { long n = Long.parseLong(args[0]); SquareTest[] tests = new SquareTest[] { new Test0(), new Test1(), new Test2(), }; for(SquareTest t : tests) { System.out.println(t.isSquare(n) + " " + t.report()); } } }