Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace TooLong
- {
- class Program
- {
- static void Main(string[] args)
- {
- double price = double.Parse(Console.ReadLine());
- int oneAgora = 0, fiveAgora = 0, tenAgora = 0, fifthyAgora = 0, oneShekel = 0, fiveShekel = 0, tenShekel = 0, twentyBill = 0, fifthyBill = 0, hundredBill = 0, twohunderdBill = 0;
- if (price - 200 >= 0)
- {
- twohunderdBill = (int)(price) / 200;
- price -= 200 * twohunderdBill;
- Console.WriteLine("{0} 200 shekel bills", twohunderdBill);
- }
- if (price - 100 >= 0)
- {
- hundredBill = (int)(price / 100);
- price -= 100 * hundredBill;
- Console.WriteLine("{0} 100 shekel bills", hundredBill);
- }
- if (price - 50 >= 0)
- {
- fifthyBill = (int)(price) / 50;
- price -= 50 * fifthyBill;
- Console.WriteLine("{0} 50 shekel bills", fifthyBill);
- }
- if (price - 20 >= 0)
- {
- twentyBill = (int)(price) / 20;
- price -= 20 * twentyBill;
- Console.WriteLine("{0} 20 shekels bill", twentyBill);
- }
- if (price - 10 >= 0)
- {
- tenShekel = (int)(price) / 10;
- price -= 10 * tenShekel;
- Console.WriteLine("{0} ten shekels", tenShekel);
- }
- if (price - 5 >= 0)
- {
- fiveShekel = (int)(price) / 5;
- price -= 5 * tenShekel;
- Console.WriteLine("{0} five shekels", fiveShekel);
- }
- if (price - 1 >= 0)
- {
- oneShekel = (int)(price);
- price -= oneShekel;
- Console.WriteLine("{0} one shekels",oneShekel);
- }
- if (price - 0.5 >= 0)
- {
- fifthyAgora = (int)(price/0.5);
- price -= 0.5*fifthyAgora;
- Console.WriteLine("{0} 50 agoras", fifthyAgora);
- }
- if(price - 0.1 >= 0)
- {
- tenAgora = (int)(price/0.1);
- price -= 0.1*tenAgora;
- Console.WriteLine("{0} ten agoras", tenAgora);
- }
- if(price - 0.05 >= 0)
- {
- fiveAgora = (int)(price/0.05);
- price -= 0.05*tenAgora;
- Console.WriteLine("{0} 5 agoras", fiveAgora);
- }
- if(price - 0.01 >= 0)
- {
- oneAgora = (int)(price / 0.01);
- price -= 0.01*tenAgora;
- Console.WriteLine("{0} 1 agoras", oneAgora);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement