Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class BabaTincheAirlines
- {
- static void Main()
- {
- string firstClass = Console.ReadLine();
- string businessClass = Console.ReadLine();
- string economyClass = Console.ReadLine();
- string[] firstParameters = firstClass.Split();
- int firstClassPassengers = int.Parse(firstParameters[0]);
- int firstFrequentFlyers = int.Parse(firstParameters[1]);
- int firstMealBuyers = int.Parse(firstParameters[2]);
- string[] businessParameters = businessClass.Split();
- int businessPassengers = int.Parse(businessParameters[0]);
- int businessFrequentFlyers = int.Parse(businessParameters[1]);
- int businessMealBuyers = int.Parse(businessParameters[2]);
- string[] economyParameters = economyClass.Split();
- int economyPassengers = int.Parse(economyParameters[0]);
- int economyFrequentFlyers = int.Parse(economyParameters[1]);
- int economyMealBuyers = int.Parse(economyParameters[2]);
- int normalFirstClassPassengers = firstClassPassengers - firstFrequentFlyers - firstMealBuyers;
- double firstClassIncome = (normalFirstClassPassengers * 7000) + (firstFrequentFlyers * 2100) +
- firstMealBuyers * 7035;
- int normalBusinessClassPassengers = businessPassengers - businessFrequentFlyers - businessMealBuyers;
- double businessClassIncome = (normalBusinessClassPassengers * 3500) + (businessFrequentFlyers * 1050) +
- businessMealBuyers * 3517.5;
- int normalEconomyBuyers = economyPassengers - economyFrequentFlyers - economyMealBuyers;
- double economyIncome = (normalEconomyBuyers * 1000) + (economyFrequentFlyers * 300) +
- (economyMealBuyers * 1005);
- int totalIncome = (int)(firstClassIncome + businessClassIncome + economyIncome);
- double maxIncome = (12 * 7035) + (28 * 3517.5) + (50 * 1005);
- int difference = (int)(maxIncome - totalIncome);
- Console.WriteLine(totalIncome);
- Console.WriteLine(difference);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement