首页 > 其他分享 >利用DoWhile结构输出1-100

利用DoWhile结构输出1-100

时间:2022-10-05 00:13:31浏览次数:46  
标签:输出 int System DoWhile 100 public

//输出1+2+3+....+100的值
package com.HuanXin.JiBen_JieGou;

public class Demo08_DoWhile {
public static void main(String[] args) {
int A = 0;
int B = 0;
do {
A = A + 1;
B = A + B;
}while (A<100);
System.out.println(B);
}
}

标签:输出,int,System,DoWhile,100,public
From: https://www.cnblogs.com/CHX249/p/16754877.html

相关文章