fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.math.*;
  5.  
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. double xA, yA, xB, yB, xC, yC; double h, S, AB, BC, AC;
  11. Scanner in = new Scanner(System.in);
  12. xA = in.nextDouble();
  13. yA = in.nextDouble();
  14. xB = in.nextDouble();
  15. yB = in.nextDouble();
  16. xC = in.nextDouble();
  17. yC = in.nextDouble();
  18. AB = Math.sqrt((xB-xA)*(xB-xA)+(yB-yA)*(yB-yA));
  19. BC = Math.sqrt((xC-xB)*(xC-xB)+(yC-yB)*(yC-yB));
  20. AC = Math.sqrt((xA-xC)*(xA-xC)+(yA-yC)*(yA-yC));
  21. if((AB>BC+AC)&&(BC>AB+AC)&&(AC>AB+BC))
  22. {
  23. System.out.printf("Treygolnik ne syshestvyet");
  24. }
  25. else
  26. {
  27. S = Math.abs((xB-xA)*(yC-yA)-(xC-xA)*(yB-yA))/2.0;
  28. h = (2*S)/ BC;
  29. System.out.printf("BC");
  30. System.out.printf(" ");
  31. System.out.printf("%.1f",h);
  32. }
  33. }
  34. }
Runtime error #stdin #stdout #stderr 0.16s 321280KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.util.NoSuchElementException
	at java.util.Scanner.throwFor(Scanner.java:862)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextDouble(Scanner.java:2413)
	at Ideone.main(Main.java:12)