Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _3_OnlineEducation
- {
- class Program
- {
- static void Main()
- {
- string firstStage = Console.ReadLine();
- int firstCount = int.Parse(Console.ReadLine());
- string secondStage = Console.ReadLine();
- int secondCount = int.Parse(Console.ReadLine());
- string thirdStage = Console.ReadLine();
- int thirdCount = int.Parse(Console.ReadLine());
- int online = 0;
- int onsite = 0;
- if (firstStage == "online")
- {
- online += firstCount;
- }
- else if (firstStage == "onsite")
- {
- onsite += firstCount;
- }
- if (secondStage == "online")
- {
- online += secondCount;
- }
- else if (secondStage == "onsite")
- {
- onsite += secondCount;
- }
- if (thirdStage == "online")
- {
- online += thirdCount;
- }
- else if (thirdStage == "onsite")
- {
- onsite += thirdCount;
- }
- if (onsite > 600)
- {
- online += onsite - 600;
- onsite = 600;
- }
- int total = online + onsite;
- Console.WriteLine($"Online students: {online}");
- Console.WriteLine($"Onsite students: {onsite}");
- Console.WriteLine($"Total students: {total}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement