37 lines
929 B
C#
37 lines
929 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();
|
|
|
|
int number;
|
|
if (int.TryParse(strNumber, out number))
|
|
{
|
|
Console.WriteLine("Sisestasid numbri {0}", number);
|
|
}
|
|
else
|
|
{
|
|
Console.WriteLine("See ei olnud number");
|
|
}
|
|
|
|
|
|
Console.Write("Vajuta mõnda klahvi lõpetamiseks");
|
|
Console.ReadKey();
|
|
}
|
|
}
|
|
}
|