使用“ For”循环填充数组

时间:2018-10-27 21:16:00

标签: c#

所以我几乎完全是一个初学者,只是做练习,我试图弄清楚如何使用for循环使用用户输入来创建和填写数组。

from psycopg2.extensions import AsIs

cur.execute("create user %s with password %s", (AsIs('abcdefgh'), '0h/9warrAttrgd8EF0gkvQ==',))

因此,这显然只是复制了Console.WriteLine("Enter the employee's name: "); string employeeName = Convert.ToString(Console.ReadLine()); Console.WriteLine("How many months do you want to input for: "); int arrayField = Convert.ToInt32(Console.ReadLine()); int[] months = new int[arrayField]; for (int i = 0; i < arrayField; i++) { Console.WriteLine("Absence for the month: "); months[0] = Convert.ToInt32(Console.ReadLine()); } 的所有内容。 我的问题是,如果您希望它填写每个条目,您将如何编写? ({months[0]months[1]等)

0 个答案:

没有答案
相关问题