Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace OnlineEducation
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int onlineStudents = 0;
- int onsiteStudents = 0;
- string educationForm;
- int studentCount;
- for (int i = 0; i < 3; i++)
- {
- educationForm = Console.ReadLine().ToLower();
- studentCount = int.Parse(Console.ReadLine());
- if (educationForm == "online")
- {
- onlineStudents += studentCount;
- }
- else
- {
- onsiteStudents += studentCount;
- }
- }
- if (onsiteStudents > 600)
- {
- onlineStudents += onsiteStudents - 600;
- onsiteStudents = 600;
- }
- Console.WriteLine($"Online students: {onlineStudents}");
- Console.WriteLine($"Onsite students: {onsiteStudents}");
- Console.WriteLine($"Total students: {onlineStudents + onsiteStudents}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement