⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chapter5n4.java

📁 JAVA源代码程序aashjkjhkjhkjhjkhkj
💻 JAVA
字号:
/** * * demonstration of the "while" statement * * Written by: Roger Garside * * First Written: 12/June/96 * Last Rewritten: 2/Oct/96 * */import java.lancs.* ;public class Chapter5n4    {    /**     *     * main     *     */    public static void main(String[] args) throws Exception        {        GroupOfPeople computing = new GroupOfPeople() ;        String s ;        System.out.println("Type a surname followed by 'return'") ;        System.out.println("(type 'return' when there are no more surnames)") ;        s = BasicIo.readString() ;        while (s.length() != 0)	    {	    computing.addSurname(s) ;	    System.out.println("inserted surname " + s) ;	    System.out.println("Type a surname followed by 'return'") ;         System.out.println("(type 'return' when there are no more surnames)") ;            s = BasicIo.readString() ;	    }        System.out.print("There are " + computing.getCount()) ;        System.out.println(" people in the group") ;        for (int i = 0 ; i < computing.getCount() ; i++)            {            System.out.print("The " + (i + 1) + "th surname is ") ;            System.out.println(computing.getSurname(i)) ;            }        } // end of method main    } // end of class Chapter5n4

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -