SaveText.Ru

эмиии
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner deni = new Scanner(System.in);
  10.  
  11.         int x = 3;
  12.         int y = 4;
  13.         int x0 = 5;
  14.         int y0 = 6;
  15.         float a = x0 - x;
  16.         float b =y0 - y;
  17.         float ab = (float) Math.sqrt(Math.pow(a, 2) + Math.pow(b , 2 ));
  18.  
  19.         System.out.println(ab);
  20.  
  21.     }
  22. }

Share with your friends:

Print