@这个程序是100的阶乘,结果怎么是负的 是不是溢出了呀
 public   class   jiecheng 
 { 
 public   static   void   main(String   args[]) 
 { 
 int   i,j=1; 
 int   t=0; 
 for   (i=1;i <=100;i++) 
          { 
             j=j*i; 
             t=t+j; 
          } 
 System.out.println( "t= "+t); 
 } 
 }     
 本人基础很差;希望大家能给点详细的说明 
------解决方案--------------------这个不是阶乘,这是阶乘的和! 
 问题是溢出了。
------解决方案--------------------public class jiecheng 
 { 
 public static void main(String args[]) 
 { 
 int i,j=1; 
 for (i=1;i <=10;i++) 
    { 
     j=j*i; 
    } 
 System.out.println(j); 
 } 
 } 
 这个是阶乘,10没有溢出
------解决方案--------------------BigInteger bi = new BigInteger( "1 ");           
         for (int i = 1; i  <= 1000; i++) { 
             bi = bi.multiply(new BigInteger(i +  " "));               
         } 
         System.out.println(num +  "! =  " + bi);
------解决方案--------------------哎  看来这问题只有我这种无聊的人来说了  处理溢出是没办法 不过你可以换个角度考虑值还是可以输出的 就是没什么意义 
 public class test 
 { 
 public static void main(String args[]) 
 { 
 int i; 
 double j=1.0; 
 int n = 0; 
 for (i=1;i <=100;i++) 
    { 
     j=j*i; 
     if(j> 10000){ 
     	n++; 
     	j/=10000; 
     }   
    } 
     System.out.println(j+ "- "+n); 
 } 
 }//最终的结果就是j*10000的n次方