-
-
Save anonymous/d016caf69537f07ded7d9ff666feb0bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Wyklad4 { | |
public static double dystans() { | |
Scanner odczyt = new Scanner(System.in); | |
System.out.println("Podaj x1"); | |
int x = odczyt.nextInt(); | |
System.out.println("Podaj y1"); | |
int y = odczyt.nextInt(); | |
System.out.println("Podaj x2"); | |
int z = odczyt.nextInt(); | |
System.out.println("Podaj y2"); | |
int v = odczyt.nextInt(); | |
odczyt.close(); | |
return Math.sqrt(((z-x)*(z-x))+((v-y)*(v-y))); | |
} | |
public static void main(String[] args) { | |
double wynik = dystans(); | |
System.out.println("Odległość punktów wynosi " +wynik); | |
System.out.println("Autor programu: XYZ"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment