Esempio n. 1
0
        static void Main(string[] args)
        {
            //Local Variables
            int     num1;
            float   f1;
            double  d1;
            decimal dec1; //More precise then double and float moves the cursor over to the correct number of positions
            object  obj1;
            dynamic dyn1;
            string  str1 = "dotnet run";


            Console.WriteLine("Hello World!, this is my first cSharp message");
            Console.WriteLine("Note: To run a cSharp project you must first create a .NET project");
            Console.WriteLine("Type in terminal the command: dotnet new console");
            Console.WriteLine("Click on the Program.cs and start creating file");
            Console.WriteLine($"To run the program type in the command: {str1} in terminal");

            char beep = '\a';

            Console.WriteLine("****Logical Operators");
            Console.WriteLine("AND is &&");
            Console.WriteLine('OR is ||');
            COnsole.WriteLine("NOT !");

            //Extracting Data from user known methods
            ConsoleKeyInfo mykey = ReadKey();

            Console.Write(key.mykey);
        }
Esempio n. 2
0
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());

        int firstPart = (2 * n + 3) - 4;

        Console.Write(new string('*', 1));
        Console.Write("\\");
        Console.Write(new string('-', firstPart));
        Console.Write("/");
        Console.Write(new string('*', 1));
        Console.WriteLine();

        int dash = firstPart - 0;

        for (int i = 2; i <= n; i++)
        {
            Console.Write(new string('*', i));
            Console.Write("\\");
            Console.Write(new string('-', dash - 2));
            Console.Write("/");
            Console.Write(new string('*', i));
            Console.WriteLine();
            dash -= 2;
        }
        int asterisksFirst  = n;
        int asterisksSecond = n / 2;

        for (int i = 0; i < n / 3; i++)
        {
            Console.Write(new string('|', 1));
            Console.Write(new string('*', asterisksSecond));
            Console.Write("\\");
            Console.Write(new string('*', asterisksFirst));
            Console.Write("/");
            Console.Write(new string('*', asterisksSecond));
            Console.Write(new string('|', 1));
            Console.WriteLine();
            asterisksFirst -= 2;
            asterisksSecond++;
        }
        for (int i = 1; i <= n; i++)
        {
            Console.Write(new string('-', i));
            Console.Write("\\");
            Console.Write(new string('*', firstPart));
            Console.Write("/");
            Console.Write(new string('-', i));
            firstPart -= 2;
            Console.WriteLine();
        }
        Console.WriteLine();
        COnsole.ReadLine();
    }
        static void Main(string[] args)
        {
            int    postcode1, postcode2;
            string adress1, adress2;

            Console.WriteLine("Write your first postcode");
            postcode1 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Write your first adress");
            adress1 = COnsole.ReadLine();
            Console.Clear();
            Console.WriteLine("Write your second postcode");
            postcode2 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Write your second adress");
            adress2 = COnsole.ReadLine();
        }
Esempio n. 4
0
 public static void Main(string[] args)
 {
     Console.WriteLine("Learning Computer Science is FUN!!!");
     COnsole.ReadKey();
 }
Esempio n. 5
0
 static void Main(string[] args)
 {
     Console.WriteLine("AAAA");
     COnsole.WriteLine("BBBB");
     Console.WriteLine("CCCC");
 }
Esempio n. 6
0
 static void Main(string[] args)
 {
     int[] array = COnsole.ReadLine().Split().Select(int.Parse).ToArray();
 }