📄 chapter5n10.java
字号:
/** * * demonstration of do ... while * * Written by: Roger Garside * * First Written: 19/March/97 * Last Rewritten: 19/March/97 * */import java.lancs.* ;public class Chapter5n10 { /** * * main * */ public static void main(String[] args) throws Exception { String response ; do { BasicIo.prompt("type a number ") ; int n = BasicIo.readInteger() ; System.out.print("the value of " + n) ; System.out.println(" is " + (n * n)) ; BasicIo.prompt("calculate more numbers (y or n)? ") ; response = BasicIo.readString().toLowerCase() ; } while ((response.length() > 0) && (response.charAt(0) == 'y')) ; } // end of method main } // end of class Chapter5n10
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -