fork(1) download
  1. class calc {
  2. public static void main(String[] args){
  3.  
  4. algorithm algorithmObject = new algorithm();
  5. algorithmObject.algorithm(1, 0, 1);
  6.  
  7. }
  8.  
  9. }
  10.  
  11. class algorithm{
  12. public void algorithm(int a, int b, int c){
  13. double x1;
  14. double square = Math.sqrt(b*b - 4*a*c);
  15. double numerator = b*-1 + square;
  16. double finalanswer = numerator/2*a;
  17.  
  18. System.out.println(finalanswer);
  19. }
  20.  
  21. }
  22.  
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
NaN