fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace rownanie_liniowe
  8. {
  9. class Program
  10. {
  11. double x = 0, a = 0, b = 0, c = 0;
  12. static void Main(string[] args)
  13. {
  14. double a = double.Parse(Console.ReadLine());
  15. double b = double.Parse(Console.ReadLine());
  16. double c = double.Parse(Console.ReadLine());
  17. double x = (c - b) / a;
  18. if (a==0 && (c-b)!=0)
  19. {
  20. Console.WriteLine("BR");
  21. }
  22. else if (a==0 && (c-b)==0)
  23. {
  24. Console.WriteLine("NWR");
  25. }
  26. else
  27. {
  28. Console.WriteLine(String.Format("{0:N2}", x));
  29. }
  30. Console.ReadKey();
  31. }
  32. }
  33. }
  34.  
Success #stdin #stdout 0.02s 16400KB
stdin
0.52 
1.60 
-5.44
stdout
-13.54