首页 > 其他 > 详细

递归入门

时间:2014-12-02 01:31:13      阅读:325      评论:0      收藏:0      [点我收藏+]
 1 import java.io.IOException;
 2 
 3 public class Digui1 {
 4 
 5     public static void main(String[] args) {
 6         // TODO Auto-generated method stub
 7         Digui1  d= new Digui1();
 8         try {
 9             d.printInput();
10         } catch (IOException e) {
11             e.printStackTrace();
12         }
13     }
14     
15     private void printInput() throws IOException {
16          char i = (char) System.in.read(); 
17          if (i != ‘#‘) {
18              printInput();
19          }
20          if (i != ‘#‘) {
21              System.out.print(i); 
22          }         
23     }
24 
25 }

bubuko.com,布布扣

递归入门

原文:http://www.cnblogs.com/hixin/p/4136412.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!