Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _04
- {
- class Program
- {
- static void Main(string[] args)
- {
- int catsCount = int.Parse(Console.ReadLine());
- int smallCats = 0;
- int mediumCats = 0;
- int bigCats = 0;
- double foodSum = 0;
- for (int i = 0; i < catsCount; i++)
- {
- int currFood = int.Parse(Console.ReadLine());
- foodSum += currFood;
- if (currFood >= 100 && currFood < 200)
- {
- smallCats++;
- }
- else if(currFood >= 200 && currFood < 300)
- {
- mediumCats++;
- }
- else if(currFood >= 300 && currFood < 400)
- {
- bigCats++;
- }
- }
- foodSum /= 1000;
- double priceSum = foodSum * 12.45;
- Console.WriteLine($"Group 1: {smallCats} cats.");
- Console.WriteLine($"Group 2: {mediumCats} cats.");
- Console.WriteLine($"Group 3: {bigCats} cats.");
- Console.WriteLine($"Price for food per day: {priceSum:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement