import java.util.Scanner;
import java.io.Console;
//参考 http://qa.helplib.com/461531
//参考 http://www.micmiu.com/lang/java/java-input-console/
public class Hello {
public static void main(String[] args) {
String str;
int r;
System.out.print("请输入半径: ");
// Java 5 的方法
Scanner scanner = new Scanner(System.in);
// str = scanner.nextLine();
// r = Integer.parseInt(str);
r = scanner.nextInt();
// scanner.close();
System.out.println("周长: " + 2 * r * Math.PI + "\n面积: " + r * r * Math.PI);
System.out.print("请输入半径: ");
// Java 6 的方法,IDE 中javaw不能获取console,故不能使用。在控制台中可以使用
Console console = System.console();
str = console.readLine();
r = Integer.parseInt(str);
System.out.println("周长: " + 2 * r * Math.PI + "\n面积: " + r * r * Math.PI);
}
}