用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。
答:如果你只是业余爱好或者编一些applet,1.4.2就足够了,而且1.4.2的学习资料也很多。要是想深入学习Jave的话就用最新的5.0版本吧,因为新版本里加入...详情>>