用JAVE编写程序
求S=1!+2!+3!+4!+……..20!
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。
答:详情>>