Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package testProje;
- import java.util.Scanner;
- public class problemB {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- while(sc.hasNext()) {
- double x1 = sc.nextDouble();
- double y1 = sc.nextDouble();
- double x2 = sc.nextDouble();
- double y2 = sc.nextDouble();
- double p = sc.nextDouble();
- double cal = (double) (Math.pow((x1-x2), p) + Math.pow((y1-y2), p));
- double ans = (double) Math.pow(cal, (1/p));
- System.out.printf("%.10f \n", (Math.abs(ans)));
- }
- sc.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement