标题:怎么返回上一层?
取消只看楼主
computerkimi
Rank: 1
来 自:江西
等 级:新手上路
帖 子:20
专家分:0
注 册:2008-8-16
 问题点数:0 回复次数:0 
怎么返回上一层?
import java.util.*;
    public class test{
        public static void main(String[] args){
            System.out.println("请按提示输入!");
            System.out.println("1、查询余额2、取款3、转账、4、退出取卡");
            Scanner input=new Scanner(System.in);
            int money=input.nextInt();

            //想在这里加个循环,让它第四次的时候重新输入,并且输入次数有限为三!怎么做?
                switch(money){
            
                    
                    case 1:
                        System.out.println("这是500元,请收好!");
                                                    
                            
                        break;
                    case 2:
                        System.out.println("请输入要转账的金额:");
                        System.out.println("请输入要转账的账号:");
                        break;
                    case 3:
                        System.out.println("请将卡收好!");
                        break;
                    case 4:
                        System.out.println("输入有误!请重新输入!");
                }
                
            }        
        }
        
}
搜索更多相关主题的帖子: public import money 
2008-08-29 17:24



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-230456-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.674382 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved