fork(1) 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.  
Runtime error #stdin #stdout #stderr 0.02s 16124KB
stdin
0.52 1.60 -5.44
stdout
Standard output is empty
stderr
Unhandled Exception:
System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <6649516e5b3542319fb262b421af0adb>:0 
  at System.Number.ParseDouble (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x0007d] in <6649516e5b3542319fb262b421af0adb>:0 
  at System.Double.Parse (System.String s) [0x0001a] in <6649516e5b3542319fb262b421af0adb>:0 
  at rownanie_liniowe.Program.Main (System.String[] args) [0x00005] in <ae8de795c0d34af99ad73693387a640c>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <6649516e5b3542319fb262b421af0adb>:0 
  at System.Number.ParseDouble (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x0007d] in <6649516e5b3542319fb262b421af0adb>:0 
  at System.Double.Parse (System.String s) [0x0001a] in <6649516e5b3542319fb262b421af0adb>:0 
  at rownanie_liniowe.Program.Main (System.String[] args) [0x00005] in <ae8de795c0d34af99ad73693387a640c>:0