Advertisement
Guest User

386/а

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