Advertisement
Guest User

385/а

a guest
Jan 20th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 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 _385a
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double k = double.Parse(Console.ReadLine());
  14. double sum = 0;
  15. int count = 0;
  16.  
  17.  
  18. while (k !=0)
  19. {
  20. double num = double.Parse(Console.ReadLine());
  21.  
  22. if (num == 0)
  23. {
  24. k = 0;
  25. }
  26.  
  27. else if (num > k)
  28. {
  29. count++;
  30. sum += num;
  31.  
  32.  
  33. }
  34.  
  35. }
  36. Console.WriteLine(sum/count);
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement