小编use*_*307的帖子

如何在C#中声明一个数组?

如何在不设置初始元素集的情况下声明数组?或者是否必须输入初始元素集?这是我的代码:

class Program
{
    static void Main(string[] args)
    {
        string ans, uname, choice, input;
        int temp;

        Console.WriteLine("Hi! We're Adrianne and Marco, today is " + DateTime.Now + ", what's yours?");
        uname = Console.ReadLine();

        do
        {
            Console.WriteLine("Hello, " + uname + "! Please select a function:");
            Console.WriteLine("1: Palindrome");
            Console.WriteLine("2: Prime or Not Prime");
            Console.WriteLine("3: Bubble Sort");
            Console.WriteLine("4: Fibonacci");
            choice = Console.ReadLine();

            if (choice == "1")
            {
                Console.WriteLine("Enter any word or string:");
                input = Console.ReadLine();
                temp = Palindrome(input);

                if (temp == 0) …
Run Code Online (Sandbox Code Playgroud)

c# arrays collections list

0
推荐指数
1
解决办法
1292
查看次数

标签 统计

arrays ×1

c# ×1

collections ×1

list ×1