Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int money;
- int cost_of_crystal = 30;
- int crystal;
- int balance_money;
- int balance_crystal;
- Console.WriteLine($"Приветствуем вас в нашем магазине кристаллов. Вы можете купить 1 кристалл за {cost_of_crystal} монет. Вы пересчитываете монеты своём кошельке. У вас:");
- money = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine($"У вас целых {money} монет.");
- crystal = money / cost_of_crystal;
- Console.WriteLine($"Вы можете купить {crystal} кристаллов. Сколько хотите купить?");
- int want_buy_crystal = Convert.ToInt32(Console.ReadLine());
- balance_crystal = want_buy_crystal;
- balance_money = money - (want_buy_crystal * cost_of_crystal);
- string buy_crystal = $"Вы купили кристаллы. Теперь у вас {balance_crystal} кристаллов и {balance_money} монет. Спасибо за покупку!";
- Console.WriteLine(buy_crystal);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement