kwest87

Untitled

Dec 23rd, 2023
1,195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.InteropServices;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApp6
  9. {
  10.     internal class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             int goldCharacter;
  15.             int characterCrystals;
  16.             int costCrystal = 5;
  17.  
  18.             Console.Write("Сколько у вас золота : ");
  19.             goldCharacter = Convert.ToInt32(Console.ReadLine());
  20.             Console.WriteLine();
  21.             Console.Write("Сколько кристаллов вы хотите приобрести : ");
  22.             characterCrystals = Convert.ToInt32(Console.ReadLine());
  23.             Console.WriteLine();
  24.  
  25.             goldCharacter -= characterCrystals * costCrystal;
  26.  
  27.             Console.WriteLine($"Куплено {characterCrystals} кристаллов , осталось {goldCharacter} золота.");
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment