本帖最后由 docwei 于 2016-3-2 23:56 编辑
class LeiJia{
public static void main(String[] args) {
int sumA=0;
for(int a=1;a<=100;a+=10){
int sum=0;
for(int b=a;b<a+10;b++){
if(b<a+9){
System.out.print(b+"+");
}else{
System.out.print(b);
}
sum +=b;
}
System.out.print("="+sum);
System.out.println();
sumA +=sum;
}
System.out.print("总和"+sumA);
}
}
|
|