23 lines
660 B
Java
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();
|
|
}
|
|
}
|
|
} |