Java do while

2019年2月12日22:21:15 发表评论 941 views
/**
 * Created by xabcd on 2019/2/12.
 */
public class TestJava_dowhile
{public static void main(String args[])
{
    int i = 1,sum = 0;
    do {
        sum +=i;
        i++;

    }while(i<=10);
        System.out.println(sum);
}
}

发表评论

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