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 _06.Profit
- {
- class Program
- {
- static void Main(string[] args)
- {
- var inOne = int.Parse(Console.ReadLine());
- var inTwo = int.Parse(Console.ReadLine());
- var inThree = int.Parse(Console.ReadLine());
- var Sum = int.Parse(Console.ReadLine());
- for (int i = 0; i <= inOne; i++)
- {
- for (int k = 0; k <= inTwo; k++)
- {
- for (int l = 0; l <= inThree; l++)
- {
- if (i * 1 + k * 2 + l * 5 == Sum)
- {
- Console.WriteLine($"{i} * 1 lv. + {k} * 2 lv. + {l} * 5 lv. = {Sum} lv.");
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement