Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Bankomat
- {
- class Program
- {
- static void Main(string[] args)
- {
- decimal amount = decimal.Parse(Console.ReadLine());
- int m = 0;
- m += Convert.ToInt32(Math.Truncate(amount / 100));
- amount = amount % 100;
- m += Convert.ToInt32(Math.Truncate(amount / 50));
- amount = amount % 50;
- m += Convert.ToInt32(Math.Truncate(amount / 20));
- amount = amount % 20;
- m += Convert.ToInt32(Math.Truncate(amount / 10));
- amount = amount % 10;
- m += Convert.ToInt32(Math.Truncate(amount / 5));
- amount = amount % 5;
- m += Convert.ToInt32(Math.Truncate(amount / 2));
- amount = amount % 2;
- m += Convert.ToInt32(Math.Truncate(amount / 1));
- amount = amount % 1;
- Console.WriteLine(m);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement