Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp35
- {
- class Program
- {
- static void Main(string[] args)
- {
- int flight = int.Parse(Console.ReadLine());
- string flightName = "";
- for (int i = 1; i <= flight; i++)
- {
- flightName = Console.ReadLine();
- int sum = 0;
- int cout = 0;
- while (true)
- {
- string passengers = Console.ReadLine();
- if (passengers == "Finish")
- {
- break;
- }
- else
- {
- int number = int.Parse(passengers);
- cout++;
- sum += number;
- }
- }
- Console.WriteLine($"{flightName} : {sum / cout} passengers.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement