Skip to content

Instantly share code, notes, and snippets.

@LevShab
Created February 21, 2015 20:36
Show Gist options
  • Save LevShab/6fad992f36c6cf0b8387 to your computer and use it in GitHub Desktop.
Save LevShab/6fad992f36c6cf0b8387 to your computer and use it in GitHub Desktop.
License
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
static void Main(string[] args)
{
string LICENSE_CONFIRM = "Согласны ли вы с условием лицензионного соглашения? (yes/no)";
string answ;
bool real = false;
int number = -15;
Console.WriteLine(LICENSE_CONFIRM);
while (real != true){
answ = Console.ReadLine();
answ = answ.ToLower();
number = answ.IndexOf("yes");
real = number >= 0;
switch(real){
case true: Console.WriteLine("Вы приняли лицензионное соглашение");
break;
case false: Console.WriteLine("Вы откозались от лицинзионного соглашения.Или соглошайтесь или закройте программу!");
break;
default: Console.WriteLine("Введи еще раз, я не понял тебя (yes/no)");
break;
}
}
Console.ReadLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment