多个数的平方与立方
import java.io.*;
class InputData {
static private String s = "";
static public void input() {
BufferedReader bu = new BufferedReader(
new InputStreamReader(System.in)
);
try {
s = bu.readLine();
}
catch (IOException e) {}
}
static public int getInt() {
input();
return Integer.parseInt(s);
}
}
class Result {
void print(int d) {
System.out.println(d + "的平方:" + d * d);
System.out.println(d + "的立方:" + d * d * d);
}
}
public class PrintResult {
public static void main(String[] args) {
Result result = new Result();
System.out.println("请输入一个整数:");
int a = InputData.getInt();
result.print(a);
}
}
我只懂得逐个逐个熟输出...请问那位高手可以告诉我怎么多个数输出?