gpt4 book ai didi

c# - Nemerle中的输入

转载 作者:太空宇宙 更新时间:2023-11-03 18:19:19 26 4
gpt4 key购买 nike

我想知道如何从表单的控制台获取输入:

M nemerle的M 14 65 99。在C#中,我这样做是:

            string[] input = System.Console.ReadLine().Split(' ');
ch = System.Char.Parse(input[0]);
a = System.Int32.Parse(input[1]);
d = System.Int32.Parse(input[2]);
m = System.Int32.Parse(input[3]);


但这在Nemerle不起作用。请建议我如何在Nemerle中进行操作。

最佳答案

class Test
{
public static Main () : void
{
def input = System.Console.ReadLine ().Split (' ');
def ch = System.Char.Parse (input[0]);
def a = System.Int32.Parse (input[1]);
def d = System.Int32.Parse (input[2]);
def m = System.Int32.Parse (input[3]);

System.Console.WriteLine ("ch:{0} a:{1} d:{2} m:{3}", ch, a, d, m);
}
}

关于c# - Nemerle中的输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1416577/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com