本帖最后由 x19881216 于 2011-05-10 15:16:55 编辑

解决方案 »

  1.   

    是这无聊的意思么?
    import java.math.BigInteger;public class Test {
    public static void main(String[] args) throws Exception {
    BigInteger value = new BigInteger("1");
    for(int i=2; i<= 100; i++) {
    BigInteger b = new BigInteger("" + i);
    value = value.multiply(b);
    }


    String tmp = value.toString();
    long sum  = 0;
    for(int i=0; i<tmp.length(); i++) {
    sum += Integer.parseInt("" + tmp.charAt(i));
    }
    System.out.println(sum);
    }
    }
      

  2.   


    m = 1
    s = 0
    (1..100).each{|a| m *= a}
    m.to_s.each_char{|i| s += i.to_i}
    p s
    Ruby的,648, 不到1秒钟就出来结果了。
      

  3.   


    import java.math.BigInteger;
    public class FTest{
    public static void main(String args[]){
    BigInteger jc=new BigInteger(""+1);
    for(int i=1;i<1000;i++){
    BigInteger bi=new BigInteger(i+"");
    jc=jc.multiply(bi);
    String s=jc.toString();
    int sum=0;
    for(int j=0;j<s.length();j++){
    sum+=Integer.parseInt(s.charAt(j)+"");
    }
    System.out.println(i+"\t\t"+sum);
    }
    }

    }647 6282
    648 6012
    649 6372
    why?
      

  4.   

     for(int i=1;i<1000;i++){
    计算到999就停了
      

  5.   

    英语太烂没看清题目是i<=100好不好。
      

  6.   

    lz,借花献佛,拜一下火龙果
    http://topic.csdn.net/u/20100722/13/17c9fe5d-c044-46f9-9ebc-adc3f4ae2f6e.html