Advertisement
gu6tera123

Untitled

Oct 23rd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1. //1
  2. import java.util.Scanner;
  3.  
  4. public class Trapec {
  5.  
  6.     public static void main(String[] args)       {
  7.         Scanner value = new Scanner(System.in);
  8.           double a = value.nextDouble();
  9.           double b = value.nextDouble();
  10.           double c = value.nextDouble();
  11.           double h = value.nextDouble();
  12.           System.out.println("S: " + ((a+b)*h)/2);
  13.  
  14.         }
  15. }
  16.  
  17.  
  18. //2
  19.  
  20. import java.util.Scanner;
  21.  
  22. public class Pravougulnik {
  23.  
  24.     public static void main (String[] args) {
  25.       Scanner value = new Scanner(System.in);
  26.         double a = value.nextDouble();
  27.         double b = value.nextDouble();
  28.         System.out.println("P = " + (2*a + 2*b));
  29.         System.out.println("S = " + a*b);
  30.        
  31.     }  
  32. }
  33.  
  34.  
  35.  
  36. //3
  37.  
  38. import java.util.Scanner;
  39.  
  40. public class Okrujnost {
  41.  
  42.     public static void main(String[] args)       {
  43.         Scanner value = new Scanner(System.in);
  44.           double r = value.nextDouble();
  45.           System.out.println("C: " + 2*3.14*r );
  46.           System.out.println("S: " + 3.14*(r*r));
  47.  
  48.         }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement