Advertisement
salma987

10:6:2-R

Jul 9th, 2023 (edited)
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.lang.Math.*;
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner in = new Scanner(System.in);
  6. int n = in.nextInt();
  7. int[] l =new int[n];
  8. for(int i=0; i<n;i++) {
  9. l[i] = in.nextInt();
  10. }
  11. for(int i=0;i<n;i++){
  12. if(l[i]>0&& l[i]<=1000) {
  13. double w = l[i] * ((double) 6 / 10.0);
  14. double r = l[i] / 5.0;
  15. double re = (l[i]) * (w);
  16. double cir = Math.PI * (r * r);
  17. double rec = (re - cir);
  18. System.out.printf("%.2f %.2f\n", cir, rec);
  19. }
  20. }
  21. }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement