【发布时间】:2013-03-13 06:44:38
【问题描述】:
这就是我想要的:
static void A(string s)
{
//Code Here...
}
static void B(string s)
{
//Code Here...
}
static void C(string s)
{
//Code Here...
}
static void Main(string[] args)
{
string temp = Console.ReadLine();
string[] s = temp.Split(' ');
if (s[0] == "A")
A(s[1]);
if (s[0] == "B")
B(s[1]);
if (s[0] == "C")
C(s[1]);
}
但是当我有很多方法时,它并不能很好地工作......
还有其他方法吗?
【问题讨论】:
-
当你有很多方法时为什么它不起作用?有什么问题?
-
至少可以使用一种方法吗?给我你的输入格式
-
Ferpega - 每次要运行方法时都必须编写 20 个 if 语句,这真的很烦人