chapter5n10.java

来自「JAVA源代码程序aashjkjhkjhkjhjkhkj」· Java 代码 · 共 42 行

JAVA
42
字号
/** * * 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 + =
减小字号Ctrl + -
显示快捷键?