Advertisement
Briotar

Homework 1

Apr 10th, 2021
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 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, quantityOfGoods;
  14.             int costCrystals = 5;
  15.             bool flag;
  16.             Console.WriteLine("Добрый день. Сколько у вас золота?");
  17.             sumGold = Convert.ToInt32(Console.ReadLine());
  18.             Console.WriteLine("Сколько кристаллов вы хотели бы приобрести?");
  19.             quantityOfGoods = Convert.ToInt32(Console.ReadLine());
  20.             sumGold =  sumGold - quantityOfGoods * costCrystals;
  21.             Console.WriteLine($"У вас в сумке - {quantityOfGoods} кристаллов. У вас осталось - {sumGold} золота");
  22.  
  23.  
  24.  
  25.         }
  26.     }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement