Advertisement
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 DZ
- {
- class Program
- {
- static void Main(string[] args)
- {
- int coins, allcrystals, crystals, torg;
- Console.WriteLine("Здравствуй, путник! Рад приветствовать тебя в своей лавке. Сколько золота ты с собой принес? ");
- Console.Write("Ваше золото: ");
- coins = Convert.ToInt32(Console.ReadLine());
- Console.Write("Количество алмазов в продаже у торговца: ");
- allcrystals = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("У меня для тебя есть " + allcrystals + " алмазов, по 3 золота за каждый. Сколько берёшь?");
- Console.Write("Количество алмазов для покупки: ");
- crystals = Convert.ToInt32(Console.ReadLine());
- torg = crystals * 3;
- Console.WriteLine("Тогда с тебя " + torg + " золота. Держи кристаллы.");
- Console.WriteLine();
- Console.WriteLine("Куплено: " + crystals + " кристаллов.");
- Console.WriteLine("У вас осталось: " + (coins - torg) + " монет.");
- Console.WriteLine("У продавца осталось: " + (allcrystals - crystals) + " кристаллов.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement