Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CSLight
- {
- class Program
- {
- static void Main(string[] args)
- {
- int rubles, dollars, euro, firstCount;
- string firstCurrency, secondCurrency, YesOrNo;
- Console.WriteLine("Привет! Давай узнаем состояние твоего счета...");
- Console.WriteLine("Сколько у тебя на счету рублей?");
- Console.WriteLine("");
- rubles = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("");
- Console.WriteLine("Отлично");
- Console.WriteLine("Сколько у тебя на счету долларов?");
- Console.WriteLine("");
- dollars = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("");
- Console.WriteLine("Да ты богач!");
- Console.WriteLine("Ну, а сколько у тебя на счету евро?");
- Console.WriteLine("");
- euro = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("");
- Console.WriteLine("Супер! Получается у тебя на счету " + rubles + " рублей, " + dollars + " долларов и " + euro + " евро!");
- Console.WriteLine("Я уверен ты хочешь часть своих сбережений перевести в одну из выше перечисленных валют!");
- while (rubles > 0 || dollars > 0 || euro > 0)
- {
- Console.WriteLine("");
- Console.WriteLine("Какую валюту ты хочешь поменять? (рубли, доллары, евро)");
- firstCurrency = Console.ReadLine();
- Console.WriteLine("");
- Console.WriteLine("Какую сумму?");
- firstCount = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("");
- Console.WriteLine("А в какую валюту ты хочешь перевести? (рубли, доллары, евро)");
- secondCurrency = Console.ReadLine();
- Console.WriteLine("");
- if (firstCurrency == "рубли" && secondCurrency == "доллары")
- {
- dollars += firstCount / 65;
- rubles -= firstCount;
- }
- else if (firstCurrency == "рубли" && secondCurrency == "евро")
- {
- euro += firstCount / 75;
- rubles -= firstCount;
- }
- else if (firstCurrency == "доллары" && secondCurrency == "рубли")
- {
- rubles += firstCount * 65;
- dollars -= firstCount;
- }
- else if (firstCurrency == "доллары" && secondCurrency == "евро")
- {
- euro += firstCount * 65 / 75;
- dollars -= firstCount;
- }
- else if (firstCurrency == "евро" && secondCurrency == "рубли")
- {
- rubles += firstCount * 75;
- euro -= firstCount;
- }
- else if (firstCurrency == "евро" && secondCurrency == "доллары")
- {
- dollars += firstCount * 75 / 65;
- euro -= firstCount;
- }
- else
- {
- Console.WriteLine("Введены некорректные данные!");
- }
- Console.WriteLine("Готово!");
- Console.WriteLine("Теперь на твоем счету: " + rubles + " рублей, " + dollars + " долларов и " + euro + " евро!");
- Console.WriteLine("");
- Console.WriteLine("Хотите провести еще операцию перевода? (да, нет)");
- Console.WriteLine("");
- YesOrNo = Console.ReadLine();
- if(YesOrNo == "нет")
- {
- Console.WriteLine("");
- Console.WriteLine("До новых встреч!");
- break;
- }
- if (rubles <= 0)
- {
- Console.WriteLine("У вас закончились рубли!");
- break;
- }
- else if (dollars <= 0)
- {
- Console.WriteLine("У вас закончились доллары!");
- break;
- }
- else if (euro <= 0)
- {
- Console.WriteLine("У вас закончились евро!");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment