标签:log ring while 循环 ... main span ati +=
1 public class TestWhile { 2 3 /** 4 * 测试循环 5 */ 6 public static void main(String[] args) { 7 int a=1; 8 while(a<=100){ 9 System.out.println(a); 10 a++; 11 } 12 System.out.println("while循环结束了 "); 13 //1+2+3+4+5....+100=? 14 int b=1; 15 int sum=0; 16 while(b<100){ 17 //sun+=b; 18 sum=sum+b; 19 b++; 20 } 21 System.out.println("从1加到100的和是:"+sum); 22 23 } 24 }
标签:log ring while 循环 ... main span ati +=
原文地址:http://www.cnblogs.com/PoeticalJustice/p/7608740.html