Last active
January 31, 2023 08:22
-
-
Save ShamilAitov/b9a8b778ad9a58e5f570b16bba26e4fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace УрокApp2 | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int gold; | |
int pricePerCrystal = 7; | |
int cryctals; | |
int remainingGold; | |
Console.Write("Привет, ты в магазине кристаллов, введи сколько у тебя золота в кошельке: "); | |
gold = Convert.ToInt32(Console.ReadLine()); | |
Console.Write($"В твоем кошельке {gold} монет золота, сколько кристаллов ты хочешь купить: "); | |
cryctals = Convert.ToInt32(Console.ReadLine()); | |
remainingGold = gold - cryctals * pricePerCrystal; | |
Console.WriteLine($"Покупка прошла: Золота осталось {remainingGold}, а Кристаллов в кошельке {cryctals}!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment