Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _04___Trainers_Salary
- {
- class Program
- {
- static void Main(string[] args)
- {
- double lections = double.Parse(Console.ReadLine());
- double budget = double.Parse(Console.ReadLine());
- double slaryForLecture = budget / lections;
- double roliSalary = 0;
- double trofonSalary = 0;
- double sinoSalary = 0;
- double jelevSalary = 0;
- double royalSalary = 0;
- double othersSalary = 0;
- for (int i = 1; i <= lections; i++)
- {
- string lector = Console.ReadLine();
- if (lector == "Roli")
- {
- roliSalary += slaryForLecture;
- }
- else if (lector == "Trofon")
- {
- trofonSalary += slaryForLecture;
- }
- else if (lector == "Sino")
- {
- sinoSalary += slaryForLecture;
- }
- else if (lector == "Jelev")
- {
- jelevSalary += slaryForLecture;
- }
- else if (lector == "RoYaL")
- {
- royalSalary += slaryForLecture;
- }
- else
- {
- othersSalary += slaryForLecture;
- }
- }
- Console.WriteLine($"Jelev salary: {jelevSalary:f2} lv");
- Console.WriteLine($"RoYaL salary: {royalSalary:f2} lv");
- Console.WriteLine($"Roli salary: {roliSalary:f2} lv");
- Console.WriteLine($"Trofon salary: {trofonSalary:f2} lv");
- Console.WriteLine($"Sino salary: {sinoSalary:f2} lv");
- Console.WriteLine($"Others salary: {othersSalary:f2} lv");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement