Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Profit
- {
- class Program
- {
- static void Main(string[] args)
- {
- int oneBGN = int.Parse(Console.ReadLine());
- int twoBGN = int.Parse(Console.ReadLine());
- int fiveBGN = int.Parse(Console.ReadLine());
- int sum = int.Parse(Console.ReadLine());
- for (int i = 0; i <= oneBGN; i++)
- {
- for (int j = 0; j <= twoBGN; j++)
- {
- for (int k = 0; k <= fiveBGN; k++)
- {
- if (i * 1 + j * 2 + k * 5 == sum)
- {
- Console.WriteLine($"{i} * 1 lv. + {j} * 2 lv. + {k} * 5 lv. = {sum} lv.");
- }
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment