其功能是求一个长整数各位数字之和:int function(long l){int sum = 0;String s = l+"";//把长整数转成字符串for(int i=0;isum +=Integer.ValueOf(s.charAt(i));}return sum; }