标题:[求助]一道C#的习题,卡住了????
只看楼主
henry576
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-12-13
得分:0 
using System;

class A
{
    public void markpro()
    {
        Console.WriteLine("please input a mark");
        while(true)
        {
            int mark=int.Parse(Console.ReadLine());
            mark=mark/10;
            switch(mark)
            {
                case 10:
                    Console.WriteLine("A");
                    break;
                case 9:
                    Console.WriteLine("A");
                    break;
                case 8:
                    Console.WriteLine("B");
                    break;
                case 7:
                    Console.WriteLine("C");
                    break;
                case 6:
                    Console.WriteLine("D");
                    break;
                default:
                    Console.WriteLine("fail");
                    break;
            }
        }
    }
}

class B
{
    static void Main()
    {
        A a=new A();
        a.markpro();
    }
}
2008-12-13 17:24



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




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

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