Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2020
585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp35
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int flight = int.Parse(Console.ReadLine());
  14. string flightName = "";
  15.  
  16. for (int i = 1; i <= flight; i++)
  17. {
  18. flightName = Console.ReadLine();
  19.  
  20. int sum = 0;
  21.  
  22. int cout = 0;
  23. while (true)
  24. {
  25. string passengers = Console.ReadLine();
  26. if (passengers == "Finish")
  27. {
  28. break;
  29. }
  30.  
  31. else
  32. {
  33. int number = int.Parse(passengers);
  34. cout++;
  35. sum += number;
  36. }
  37.  
  38.  
  39. }
  40. Console.WriteLine($"{flightName} : {sum / cout} passengers.");
  41. }
  42.  
  43.  
  44.  
  45. }
  46. }
  47. }
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement