如何读取wpf中的数组元素(从文本框输入到数组) [英] how to read array elements in wpf(input from a textbox to an array)
本文介绍了如何读取wpf中的数组元素(从文本框输入到数组)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
static void Main(string[] args)
{
int i;
int[] arr = new int[4]; // 4 size array
for (i = 0; i<4; i++)
{
Console.Write("\nEnter your number:\t");
//Storing value in an array
arr[i] = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine("\n\n");
//Printing the value on console
for (i = 0; i<4; i++)
{
Console.WriteLine("you entered {0}", arr[i]);
}
Console.ReadLine();
}
在控制台中,我想知道它是怎么回事wpf
从文本框输入到数组
推荐答案
同样的方式
for(int i = 0; i< n; i ++)
{
answer [i] = Console.ReadLine();
}
the same way
for (int i = 0; i < n; i++)
{
answer[i] = Console.ReadLine();
}
这篇关于如何读取wpf中的数组元素(从文本框输入到数组)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文