c#如何接受数据 C#中有没有想C一样的printf的功能,怎么样实现从外界接受数据,比如说接受4个整数?不是说console.readline,我是想一次就接受4个整数,怎么做?不用文本框,我在CSC底下调试...... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 class Program { static void Main(string[] args) { string str = Console.ReadLine(); string[] arra = str.Split(new char[] {','}); foreach (string s in arra) { Console.WriteLine(s); } } } static void Main(string[] args){ string strInput = Console.ReadLine(); string[] arrInput = strInput.Split(','); foreach (string str in arrInput) { Console.WriteLine(str); }} 谢谢大家,4楼的朋友是正解,5楼的还是有点问题就在这一句上 string[] arra = str.Split(new char[] {','}); 我还是想问一下,Main()的参数string[] args有什么用啊,好象就没有用到啊?还有这句string[] arra = str.Split(new char[] {','});麻烦帮我解释一下,new char[]什么意思? new char[]什么意思?是new一个char型的数组 有些难度问题 求解答 如何获取图片中主体颜色 常见的网络攻击揭秘 Combobox SelectedIndex问题 求一正则表达式 [求助]服务器到客户端(IE)的运行原理是什么? Winform:关于DataGrid序号问题! C#控制台问题 为什么李维现在才出了一本VCL深入架构陂析? 关于pictureBox控件的一个简单问题 在有VS的环境下,程序能正常运行,没有的情况下会报错(都有.net framework4.0环境),错误日志如下 关于Remoting的问题 vb.net没人回答,到c#帮忙解决,谢谢
{
static void Main(string[] args)
{
string str = Console.ReadLine();
string[] arra = str.Split(new char[] {','});
foreach (string s in arra)
{
Console.WriteLine(s);
}
}
}
{
string strInput = Console.ReadLine();
string[] arrInput = strInput.Split(',');
foreach (string str in arrInput)
{
Console.WriteLine(str);
}
}
就在这一句上 string[] arra = str.Split(new char[] {','});
麻烦帮我解释一下,new char[]什么意思?
是new一个char型的数组