rukvir

HW 1_6

Jan 30th, 2025
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace HW_2025
  9. {
  10.     internal class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             float gold, crystal;
  15.             float convertIndexG = 10;
  16.  
  17.             Console.WriteLine("Hi! Сколько у вас ЗОЛОТА?");
  18.             gold = Convert.ToSingle(Console.ReadLine());
  19.  
  20.             Console.WriteLine("\nБу, купи голды!\n\n" +
  21.                 "К У Р С\n" +
  22.                 "########\n" +
  23.                 "10g = 3cr\n" +
  24.                 "Сколько желаешь купить кристалов?");
  25.             crystal = Convert.ToSingle(Console.ReadLine());
  26.             gold = gold - (convertIndexG  * crystal);
  27.  
  28.             Console.WriteLine($"У вас на счете:\n" +
  29.                 $"Золота = {gold}\n" +
  30.                 $"Кристалов = {crystal}");
  31.  
  32.             Console.ReadKey();
  33.  
  34.         }
  35.     }
  36. }
  37.  
  38.  
Advertisement
Add Comment
Please, Sign In to add comment