Advertisement
maus234

Untitled

Aug 14th, 2021
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 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 Leson01
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.            
  14.             Console.WriteLine("Сколько у золота ?");
  15.             int bagOfCoins = Convert.ToInt32(Console.ReadLine());
  16.             Console.WriteLine("Цена кристалла - 2:1 .Сколько вам нужно купить кристаллов ?");
  17.             int buyingСrystals = Convert.ToInt32(Console.ReadLine());
  18.             int restOfGold = bagOfCoins - (buyingСrystals * 2);
  19.             int numberOfCrystals = bagOfCoins / buyingСrystals;
  20.             Console.WriteLine("Остаток золота" + " " + restOfGold);
  21.             Console.WriteLine("Количество кристаллов" + " " + numberOfCrystals);
  22.  
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement