Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CatFood
- {
- class Program
- {
- static void Main(string[] args)
- {
- int num = int.Parse(Console.ReadLine());
- int firstGroup = 0;
- int secondGroup = 0;
- int thirdGroup = 0;
- double totalFood = 0;
- for (int i = 0; i < num; i++)
- {
- double food = double.Parse(Console.ReadLine());
- totalFood += food;
- if (food >= 100 && food < 200)
- {
- firstGroup++;
- }
- else if (food >= 200 && food < 300)
- {
- secondGroup++;
- }
- else if (food >= 300 && food < 400)
- {
- thirdGroup++;
- }
- }
- double price = totalFood * 0.01245;
- Console.WriteLine($"Group 1: {firstGroup} cats.");
- Console.WriteLine($"Group 2: {secondGroup} cats.");
- Console.WriteLine($"Group 3: {thirdGroup} cats.");
- Console.WriteLine($"Price for food per day: {price:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement