Vapio

task3

Mar 3rd, 2021 (edited)
653
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.                    
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         uint crystalsPrice = 300;
  8.  
  9.         uint goldAmount = 0;
  10.         uint crystalsAmount = 0;
  11.        
  12.         string crystalsPriceStr = String.Format("Price of crystal is : {0}\n", crystalsPrice);
  13.        
  14.         Console.WriteLine(crystalsPriceStr);
  15.        
  16.         Console.WriteLine("Please input amount of gold : ");
  17.         goldAmount = Convert.ToUInt32(Console.ReadLine());
  18.        
  19.         crystalsAmount = goldAmount / crystalsPrice;
  20.         goldAmount -= (crystalsAmount * crystalsPrice);
  21.        
  22.         string crystalsAmountString = String.Format("Amount of bought crystals : {0}", crystalsAmount);    
  23.         string goldAmountString = String.Format("Amount of gold : {0}", goldAmount);
  24.        
  25.         Console.WriteLine(crystalsAmountString);
  26.         Console.WriteLine(goldAmountString);
  27.     }
  28. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×