package _08_while;

public class Test2 {
    public static void main(String[] args) {
        /**
         * 练习 3：计算从 1 开始的累加和，直到和大于 1000 为止

         */
        int sum = 0;
        int i = 1;

        while (sum < 1000){
            sum += i;
            i ++;
        }
        System.out.println(sum);
        System.out.println(i);
    }
}
