Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace VendingMachine
- {
- public class VendingMachine
- {
- public static void Main()
- {
- string command = Console.ReadLine();
- int coinsInserted = 0;
- int moneyAvailable = 0;
- while (command != "Start")
- {
- coinsInserted = int.Parse(command);
- if (coinsInserted != 0.1 ||
- coinsInserted != 0.2 ||
- coinsInserted != 0.5 ||
- coinsInserted != 1 ||
- coinsInserted != 2)
- {
- Console.WriteLine($"Cannot accept {coinsInserted}");
- continue;
- }
- moneyAvailable += coinsInserted;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement