Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Coins
- {
- class Program
- {
- static void Main(string[] args)
- {
- double Money = double.Parse(Console.ReadLine());
- double Resto = Money * 100;
- double countCoint = 0;
- while (Resto > 0)
- {
- if (Resto >= 200)
- {
- Resto -= 200;
- }
- else if (Resto >= 100)
- {
- Resto -= 100;
- }
- else if (Resto >= 50)
- {
- Resto -=50;
- }
- else if (Resto >= 20)
- {
- Resto -=20;
- }
- else if (Resto >= 10)
- {
- Resto -=10;
- }
- else if (Resto >= 5)
- {
- Resto -=5;
- }
- else if (Resto >= 2)
- {
- Resto -=2;
- }
- else if (Resto >= 1)
- {
- Resto--;
- }
- else
- {
- break;
- }
- countCoint++;
- }
- Console.WriteLine(countCoint);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment