fork download
  1. package ksiezycebajtka;
  2. import java.util.Scanner;
  3.  
  4. class KsiezyceBajtka {
  5.  
  6.  
  7. public static void main(String[] args)
  8. {
  9. Scanner odczyt = new Scanner(System.in);
  10. int ile = odczyt.nextInt();
  11. Scanner odczyt2 = new Scanner(System.in);
  12. for(int i=0;i<ile;i++)
  13. {
  14. int j=0;
  15. double tab[];
  16. tab = new double[2];
  17. String input = odczyt2.nextLine();
  18. String[] numbers = input.split(" ");
  19. for (String s : numbers) {
  20. tab[j]=Double.valueOf(s);
  21. j++;
  22.  
  23. }
  24. double k=4*tab[0]*tab[0]+4*tab[1]*tab[1];
  25. double c = Math.pow(k,0.5);
  26. double poleTr=0.5*2*2*tab[0]*tab[1];
  27. double pA=Math.PI*tab[0]*tab[0];
  28. double pB=Math.PI*tab[1]*tab[1];
  29. double pCalkowite=poleTr+0.5*pA+0.5*pB;
  30. double pO=Math.PI*0.25*c*c;
  31. double pSzukane=pCalkowite-0.5*pO;
  32. System.out.println(pSzukane);
  33.  
  34. }
  35.  
  36.  
  37. }
  38.  
  39. }
Runtime error #stdin #stdout #stderr 0.11s 321024KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: Could not find or load main class KsiezyceBajtka