MavenAntlrIntegration/src/main/java/b1/Main.java
shing19m 48d0fd0124 Updated junit to the newest version (4.11).
Updated jline to the newest version (2.11).
Updated code to match the new structure of jline.
Updated version of maven-shade-plugin to the newest version (2.1).
Updated version of antlr3-maven-plugin to the newest version (3.5).
Updated version of maven-compiler-plugin to the newest version (2.5.1).
Updated version of antlr-runtime to the newest version (3.5).
2013-07-23 20:35:38 +02:00

23 lines
660 B
Java

package b1;
import java.io.IOException;
import java.io.PrintWriter;
import jline.console.ConsoleReader;
public class Main {
public static void main(String[] args) throws IOException {
ConsoleReader reader = new ConsoleReader();
String line;
PrintWriter out = new PrintWriter(System.out);
while ((line = reader.readLine("number or quit> ")) != null) {
if (line.equalsIgnoreCase("quit")) {
break;
}
int i = Integer.parseInt(line);
System.out.println(
Math.square(i) + " ist " + i + " quadriert");
out.flush();
}
}
}