| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 455 人关注过本帖
标题:程序出错?求高手给看看?
取消只看楼主 加入收藏
E_xuan
Rank: 1
等 级:新手上路
帖 子:30
专家分:1
注 册:2009-9-13
结帖率:90%
收藏
已结贴  问题点数:20 回复次数:0 
程序出错?求高手给看看?
using System;
class Test18{
    public static void Main(){
        string myInput;
        int myInt;
        begin:
            Console.Write("Please enter a number between 1 and 3:");
        myInput=Console.ReadLine();
        myInt=Int32.Parse(myInput);
        switch(myInt){
            case 1:
                Console.WriteLine("Your number is {0}.",myInt);
            break;
            case 2:
                Console.WriteLine("Your number is {0}.",myInt);
            break;
            case 3:
                Console.WriteLine("Your number is {0}",myInt);
            break;
            default:
                Console.WriteLine("Your number {0} is not between 1 and 3.",myInt);
            }
            decide:
                Console.Write("Type \"continue\" to go on or \"quit\" to stop:");
            myInput=Console.ReadLine();
            switch(myInput){
            case "continue":
                goto begin;
            case "quit":
                Console.WriteLine("Bye.");
            break;
            default:
            Console.WriteLine("Your input {0} is incorrect.",myInput);
            goto decide;
            }
    }
}
红色标记下面一定要加break?
搜索更多相关主题的帖子: between public number 
2009-09-13 10:29
快速回复:程序出错?求高手给看看?
数据加载中...
 
   



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

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