public class WhileTest {
//求100以内6的倍数的个数。
public static void main (String[] args){
int x = 1;
int sum =0;
while(x*6<101){
sum=x++;
}
System.out.println("100以内6的倍数有"+sum+"个");
}
}
原文:http://www.cnblogs.com/xingbaoliang/p/3916141.html