Advertisement
blackpab

z1

Feb 27th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.06 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package zestaw;
  7. import java.util.Scanner;
  8.  
  9. /**
  10.  *
  11.  * @author student
  12.  */
  13. public class Zestaw {
  14.  
  15.     /**
  16.      * @param args the command line arguments
  17.      */
  18.     public static void main(String[] args) {
  19.         // TODO code application logic here
  20.         Scanner skaner = new Scanner(System.in);
  21.         System.out.println("LiczbaA = ");
  22.             double LiczbaA = skaner.nextDouble();
  23.         System.out.println("LiczbaB = ");
  24.             double LiczbaB = skaner.nextDouble();
  25.            
  26.         double sa = (LiczbaA+LiczbaB)/2;
  27.         double sg = Math.sqrt(LiczbaA * LiczbaB);
  28.         double shOdw = 1/LiczbaA + 1/LiczbaB;
  29.         double sh = 1/shOdw;
  30.        
  31.         System.out.println("arytmetyczna: " + sa + " geometryczna: " + sg + " harmoniczna: " + sh );
  32.        
  33.        
  34.        
  35.        
  36.        
  37.        
  38.        
  39.  
  40.        
  41.     }
  42.    
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement