Created
February 21, 2015 20:36
-
-
Save LevShab/6fad992f36c6cf0b8387 to your computer and use it in GitHub Desktop.
License
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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