• 1404/08/21

دریافت مدل چند ماشین از کاربر :

using System;

class Program
{
    static void Main()
    {
        Console.Write("Enter number of cars: ");
        int count = int.Parse(Console.ReadLine());

        string[] models = new string[count];

        for (int i = 0; i < count; i++)
        {
            Console.Write($"Enter model of car #{i + 1}: ");
            models[i] = Console.ReadLine();
        }

        Console.WriteLine("\n--- Car Models ---");
        for (int i = 0; i < count; i++)
        {
            Console.WriteLine($"Car #{i + 1}: {models[i]}");
        }

        Console.ReadKey();
    }
}
  • 1404/08/21
  • ساعت 22:29

بسیار عالی ؛ احسنت دوست من


logo-enamadlogo-samandehi