Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string input = Console.ReadLine().ToLower();
- double sum = 0;
- while (input != "start")
- {
- double coins = double.Parse(input);
- switch (coins)
- {
- case 0.1:
- sum += 0.1;
- break;
- case 0.2:
- sum += 0.2;
- break;
- case 0.5:
- sum += 0.5;
- break;
- case 1.0:
- sum += 1.0;
- break;
- case 2.0:
- sum += 2.0;
- break;
- default:
- Console.WriteLine($"Cannot accept {coins}");
- break;
- }
- input = Console.ReadLine().ToLower();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement