问答题

以下程序,循环体共执行了多少次?
public class test {
public static void main(String a[]) {
int k=10;
int count=0;
while(k>=0) {
k--;
count+=1;
}
System.out.println("循环共执行了"+count+"次");
}
}

答案: 循环共执行了11次
微信扫码免费搜题