Java while用法

2019年2月12日22:08:52 发表评论 958 views
/**
 * Created by xabcd on 2019/2/12.
 */
public class TestJava_while
{public static void main(String args[])
{
    int i = 1, sum = 0;
    while(i<=10)
    {
        sum += i;
        i++;
    }
    System.out.println(sum);
}
}

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: