URI Online Judge Solution 1015 Distance Between Two Points – URI 1015 Solution in C, C++, Java, Python and C#

URI Online Judge Solution 1015 Distance Between Two Points | Beginner
URI Problem Link – https://www.urionlinejudge.com.br/judge/en/problems/view/1015

Problem Name: 1015 Distance Between Two Points solution
Problem Number : URI – 1015 Distance Between Two Points code
Online Judge : URI Online Judge Solution
Category: Beginner
Solution Language : C,C plus plus, java, python, c#(c sharp)

URI Solution 1015 Distance Between Two Points Code in C / URI 1015 code in C:

#include <stdio.h>
#include <math.h>

int
main()
{

double
x1, x2, y1, y2, dist;

scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);

dist = sqrt(pow(x2-x1,2)+pow(y2-y1,2));

printf("%.4lfn", dist);
return
0;
}

URI Solution 1015 Distance Between Two Points Code / URI 1015 solution in CPP:

#include <stdio.h>
#include <math.h>

int
main()
{

double
x1, x2, y1, y2, dist;

scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);

dist = sqrt(pow(x2-x1,2)+pow(y2-y1,2));

printf("%.4lfn", dist);
return
0;
}

URI Solution 1015 Distance Between Two Points Code / URI 1015 solution in Java:

import java.util.Scanner;


public class
Main {


public static
void main(String[] args) {
double
x1, x2, y1, y2, dist;

Scanner sc = new Scanner(System.in);
x1 = sc.nextDouble();
y1 = sc.nextDouble();
x2 = sc.nextDouble();
y2 = sc.nextDouble();

dist = Math.sqrt(Math.pow(x2-x1,2)+Math.pow(y2-y1,2));

System.out.printf("%.4fn", dist);

}

}

URI Solution 1015 Distance Between Two Points Code / URI 1015 solution in  Python:

import math

linha1 = input().split(" ")
linha2 = input().split(" ")

x1,y1 = linha1
x2,y2 = linha2

distancia = math.sqrt(((float(x2) - float(x1))*(float(x2) - float(x1))) + ((float(y2)-float(y1)) *(float(y2)-float(y1))))

print("%0.4f" %distancia)

URI Solution 1015 Code / URI 1015 solution in  C# (C Sharp):

Demonstration:

Look for this problems ,

URI Online Judge Solution 1015 Distance Between Two Points - URI 1015 solution

So, our code is:

        scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);

dist = sqrt(pow(x2-x1,2)+pow(y2-y1,2));

Just implement this in coding. Since having any problem just put a comment below. Thanks

Tags: URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver, URI all problem solution list, URI Distance Between Two Points code in C, URI 1015 Distance Between Two Points code in C++, URI Distance Between Two Points solution in C, URI solution, URI 1015 Distance Between Two Points solution in C,URI 1015 Distance Between Two Points solution in C++-CPP,URI 1002 solution in C# (C sharp),URI 1002 solution in Java,URI 1015 Distance Between Two Points solution in Python,

By Maniruzzaman Akash

Maniruzzaman Akash is a freelance web developer with most popular Laravel PHP frameork and Vue JS

Leave a Reply

Your email address will not be published. Required fields are marked *