Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         // TODO code application logic here
  9.         Scanner sc=new Scanner(System.in);
  10.         double r=2.0,w=6.0;
  11.         while(sc.hasNext()){
  12.             int t=sc.nextInt();
  13.             for(int i=1;i<=t;i++){
  14.             int l=sc.nextInt();
  15.             double a1=(double) (Math.PI*(r*r));
  16.             double a2=(l*w)-a1;
  17.                 System.out.printf("%.2lf %.2lf\n",a1,a2);
  18.             }
  19.         }
  20.     }
  21.    
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement