38 lines
913 B
C#
38 lines
913 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace KonsooliDemo
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
Console.WriteLine("Tere Maailm!");
|
|
Console.Write("Mis on sinu nimi? ");
|
|
var consoleKeyInfo = Console.ReadLine();
|
|
Console.WriteLine("Tere {0}", consoleKeyInfo);
|
|
|
|
Console.Write("Sisesta number: ");
|
|
var strNumber = Console.ReadLine();
|
|
|
|
try
|
|
{
|
|
int number = int.Parse(strNumber);
|
|
Console.WriteLine(number);
|
|
}
|
|
catch (FormatException)
|
|
{
|
|
Console.WriteLine("See ei olnud number");
|
|
}
|
|
|
|
|
|
|
|
Console.Write("Vajuta mõnda klahvi lõpetamiseks");
|
|
Console.ReadKey();
|
|
}
|
|
}
|
|
}
|