1. 当测试用例不造有多少时
Scanner scan = new Scanner(System.in); while(scan.hasNext()){ }
刷题小技巧
原文:http://www.cnblogs.com/zhihuayun/p/7376472.html