Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp3
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- //INPUT
- int numberCats = int.Parse(Console.ReadLine());
- //CHANGEABLE INPUT
- double currentGramsFoodEaten = 0;
- double gramsFoodSum = 0;
- int littleKittensCount = 0;
- int bigCatsCount = 0;
- int massiveCatsCount = 0;
- //CALCULATIONS
- for (int i = 1; i <= numberCats; i++)
- {
- currentGramsFoodEaten = double.Parse(Console.ReadLine());
- gramsFoodSum += currentGramsFoodEaten;
- //Sizes
- if (currentGramsFoodEaten >= 100 && currentGramsFoodEaten < 200)
- {
- littleKittensCount++;
- }
- else if (currentGramsFoodEaten >= 200 && currentGramsFoodEaten < 300)
- {
- bigCatsCount++;
- }
- else if (currentGramsFoodEaten >= 300 && currentGramsFoodEaten < 400)
- {
- massiveCatsCount++;
- }
- }
- double kilogramsFoodPerDay = gramsFoodSum / 1000;
- double averageFoodPerDay = kilogramsFoodPerDay * 12.45;
- //OUTPUT
- Console.WriteLine($"Group 1: {littleKittensCount} cats.");
- Console.WriteLine($"Group 2: {bigCatsCount} cats.");
- Console.WriteLine($"Group 3: {massiveCatsCount} cats.");
- Console.WriteLine($"Price for food per day: {averageFoodPerDay:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement