标签:eal dal rgs deb dso sarg dbv oss fhs
用while语句求1~100之和
public class Ex3_5 {
public static void main(String[] args){
int n=1,sum=0;
while(n<=100)
{
sum+=n;
n++;
}
System.out.println("sum="+sum);
}
}
标签:eal dal rgs deb dso sarg dbv oss fhs
原文地址:http://www.cnblogs.com/duzhaonan/p/5992280.html