Header Ads

Header ADS

URI 1015 Distance Between Two Points Solution in C++

URI 1015 đź‘€ Distance Between Two Points đź‘€Solution in C++

URI Online Judge Solution 1015 Distance Between Two Points in C++
Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.
https://www.urionlinejudge.com.br/judge/en/problems/view/1015

URI Online Judge Solution1015 Distance Between Two Points in C++


#include<bits/stdc++.h>
#include<math.h>
using namespace std;

int main(){
    double x1,y1,x2,y2,Distance=0;

    cin>>x1>>y1;
    cin>>x2>>y2;

    Distance=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));

    cout<<fixed;
    cout<<setprecision(4)<<Distance<<endl;

return 0;}



No comments

URI 1070 Six Odd Numbers Solution in C++

URI 1070 Six Odd Numbers Solution in C++ Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just fin...

Powered by Blogger.