while
来源:互联网 发布:java数据结构 编辑:程序博客网 时间:2024/05/21 18:35
今天复习了一下最近学的java
0-9的输出
public Class TestWhile{
public static void main (String [] args){
int i=0;
while(i<=9){
system.out.print(i);
}
}
}
输出1-100内前五个被3整除的数
public Class TestWhile{
public static void main (String [] args){
int i=0;
int num=0;
while(i<=100){
if(i%3==0){
system.out.print(i);
num++;
if(num=5) break;
}i++;
}
}
}
0 0
- ********************* while *********************
- while
- while
- while
- do...break...while >>> while
- do- while 与while
- While与do While
- do while与while
- while&do-while
- do---while 和 while
- while&do-while
- while和do while
- while,do while循环
- while与do while
- while和do while
- while(0),while(1),while(表达式)
- while循环
- do-while
- 图灵机器人————在线一对一人机聊天
- 热敏打印机驱动研究
- 全排列算法的实现(纠正“啊哈”算法书籍中的错误)
- 学习之路之Activity的生命周期
- java对redis的基本操作
- while
- 注册电气工程师考试,专业部分,供配电教材,推荐
- 韩顺平 java 第十讲 重载、覆盖
- C++中一些概念
- 解决java.net.MalformedURLException: unknown protocol: c问题
- RecyclerView
- Windows消息响应机制
- 我的PHP学习之路
- HDOJ 1847 Good Luck in CET-4 Everybody!(巴什博奕)