爱问知识人 爱问教育 医院库

用JAVE编写程序

首页

用JAVE编写程序

求S=1!+2!+3!+4!+……..20!

提交回答
好评回答
  • 2018-02-13 13:30:01
      import  。*;
    class text{
    	public static void main(String args[]){
    		int result,temp,i,j,n;
    		String s;
    		result = 0;
    		try{
    			 int("please input n:");
    			BufferedReader br=new BufferedReader(new InputStreamReader( ));
    			s= adLine();
    			n= rseInt(s);
    			for(i=1;i<=n;i++){
    				temp=1;
    				for(j=1;j<=i;j++){
    					temp*=j;
    				}
    				result+=temp;
    			}
    		}catch(IOException e){}
    		 intln("the result is:"+result);
    	}
    }
    保存文件名为text。
      java。

    天***

    2018-02-13 13:30:01

  • 软件 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新资料 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):