Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // תרגיל 9 //
- Console.WriteLine("Enter how much money you put in the machine:");
- int put = int.Parse(Console.ReadLine());
- int give;
- int give2;
- int left = put % 21;
- if (put < 21)
- {
- give = put / 7;
- Console.WriteLine("Te machine need to give you back {0} cions of seven.", give);
- }
- else if (put > 21)
- {
- give = put / 21;
- Console.WriteLine("The machine need to give you back " + give + " coins of 21.");
- if (left < 21 && left >= 7)
- {
- give2 = left / 7;
- Console.WriteLine("And the machine need to give you back {0} coins of seven.", give2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement