日期:2014-05-20 浏览次数:20824 次
import java.io.*; public class TestN2 { public static void main(String args[]) throws IOException { double n,x; try { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); n=Integer.parseInt(br.readLine()); int s=1; for( double i=1;i<=n;i++ ) { s*=i; } System.out.println("n!="+s); } catch(ArrayIndexOutOfBoundsException e) { System.out.println("命令行没有输入参数或参数不足"); } catch(NumberFormatException e) { System.out.println("输入的参数不是数字"); } } }