Skip to content

Instantly share code, notes, and snippets.

@ShamilAitov
Last active January 31, 2023 08:22
Show Gist options
  • Save ShamilAitov/b9a8b778ad9a58e5f570b16bba26e4fa to your computer and use it in GitHub Desktop.
Save ShamilAitov/b9a8b778ad9a58e5f570b16bba26e4fa to your computer and use it in GitHub Desktop.
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