Advertisement
xomanya

1.7

Aug 15th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.57 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace DZ
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int coins, allcrystals, crystals, torg;
  14.             Console.WriteLine("Здравствуй, путник! Рад приветствовать тебя в своей лавке. Сколько золота ты с собой принес? ");
  15.             Console.Write("Ваше золото: ");
  16.             coins = Convert.ToInt32(Console.ReadLine());
  17.             Console.Write("Количество алмазов в продаже у торговца: ");
  18.             allcrystals = Convert.ToInt32(Console.ReadLine());
  19.             Console.WriteLine("У меня для тебя есть " + allcrystals + " алмазов, по 3 золота за каждый. Сколько берёшь?");
  20.             Console.Write("Количество алмазов для покупки: ");
  21.             crystals = Convert.ToInt32(Console.ReadLine());
  22.             torg = crystals * 3;
  23.             Console.WriteLine("Тогда с тебя " + torg + " золота. Держи кристаллы.");
  24.             Console.WriteLine();
  25.             Console.WriteLine("Куплено: " + crystals + " кристаллов.");
  26.             Console.WriteLine("У вас осталось: " + (coins - torg) + " монет.");
  27.             Console.WriteLine("У продавца осталось: " + (allcrystals - crystals) + " кристаллов.");
  28.  
  29.  
  30.  
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement