Advertisement
pol9na

Untitled

Feb 29th, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 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 Сprogect
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int money;
  14.             int eatCount;
  15.             int eatPrice = 10;
  16.            
  17.  
  18.             Console.WriteLine("Добро пожаловать в магазин!Сегодня кристаллы по "+eatPrice+" монет");
  19.             Console.Write("Сколько у вас золота?:");
  20.             money = Convert.ToInt32(Console.ReadLine());
  21.             Console.Write("Сколько кристаллов вам нужно?:");
  22.             eatCount = Convert.ToInt32(Console.ReadLine());
  23.             money -= eatCount * eatPrice;
  24.             if (money >= 0)
  25.             { Console.WriteLine("У вас в сумке-" + eatCount + "кристаллов и " + money + "монет"); }
  26.             else
  27.             { Console.WriteLine("У вас недостаточно денег"); }
  28.             Console.ReadKey();
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement