Advertisement
Briotar

Homework 1.2

Apr 13th, 2021
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 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 Lesson1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int sumGold;
  14.             int quantityGoods;
  15.             int costCrystals = 5;
  16.             Console.WriteLine("Добрый день. Сколько у вас золота?");
  17.             sumGold = Convert.ToInt32(Console.ReadLine());
  18.             Console.WriteLine("Сколько кристаллов вы хотели бы приобрести?");
  19.             quantityGoods = Convert.ToInt32(Console.ReadLine());
  20.             sumGold = sumGold - quantityGoods * costCrystals;
  21.             Console.WriteLine($"У вас в сумке - {quantityGoods} кристаллов. У вас осталось - {sumGold} золота");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement