import java.io.*; |
/* |
* OutputKeyPress.java |
* |
* Created on 2006年8月23日, 上午9:27 |
* |
* 接收键盘输入数据 |
*/ |
public class OutputKeyPress { |
public static void main(String[] args) { |
System.out.println( "This is a example about acceptance of keyboard." ); |
String tempStr = "0" ; |
try { |
InputStreamReader inputReader; |
BufferedReader bufReader; |
inputReader = new InputStreamReader(System.in); |
bufReader = new BufferedReader(inputReader); |
tempStr = bufReader.readLine(); |
System.out.println( "Input num is: " + tempStr); |
} catch (IOException e) { |
e.printStackTrace(); |
} |
int n = Integer.parseInt(tempStr); |
int nultiNum = 1 ; |
for ( int i = 1 ; i <= n; i++) { |
nultiNum *= i; |
} |
System.out.println( "multiply of input number is: " + nultiNum); |
} |
} |