Advertisement
Guest User

16

a guest
May 26th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _16_ComparingFloats
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double num1 = double.Parse(Console.ReadLine());
  10. double num2 = double.Parse(Console.ReadLine());
  11.  
  12. double eps = 0.000001;
  13. double difference = Math.Max(num1, num2) - Math.Min(num1, num2);
  14.  
  15. if (difference > eps)
  16. {
  17. Console.WriteLine("False");
  18. }
  19. else
  20. {
  21. Console.WriteLine("True");
  22. }
  23.  
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement