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 lectureSalary = (budget / lections);
- double roli = 0;
- double trofon = 0;
- double sino = 0;
- double jelev = 0;
- double royal = 0;
- double others = 0;
- for (int i = 1; i <= lections; i++)
- {
- string lector = Console.ReadLine();
- if (lector == "Roli")
- {
- roli += lectureSalary;
- }
- else if (lector == "Trofon")
- {
- trofon += lectureSalary;
- }
- else if (lector == "Sino")
- {
- sino += lectureSalary;
- }
- else if (lector == "Jelev")
- {
- jelev += lectureSalary;
- }
- else if (lector == "RoYaL")
- {
- royal += lectureSalary;
- }
- else
- {
- others += lectureSalary;
- }
- }
- Console.WriteLine($"Jelev salary: {jelev:f2} lv");
- Console.WriteLine($"RoYaL salary: {royal:f2} lv");
- Console.WriteLine($"Roli salary: {roli:f2} lv");
- Console.WriteLine($"Trofon salary: {trofon:f2} lv");
- Console.WriteLine($"Sino salary: {sino:f2} lv");
- Console.WriteLine($"Others salary: {others:f2} lv");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment