Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package zestaw;
- import java.util.Scanner;
- /**
- *
- * @author student
- */
- public class Zestaw {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- Scanner skaner = new Scanner(System.in);
- System.out.println("LiczbaA = ");
- double LiczbaA = skaner.nextDouble();
- System.out.println("LiczbaB = ");
- double LiczbaB = skaner.nextDouble();
- double sa = (LiczbaA+LiczbaB)/2;
- double sg = Math.sqrt(LiczbaA * LiczbaB);
- double shOdw = 1/LiczbaA + 1/LiczbaB;
- double sh = 1/shOdw;
- System.out.println("arytmetyczna: " + sa + " geometryczna: " + sg + " harmoniczna: " + sh );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement