人生第一道水題 計算兩點間距離
#include<stdio.h>
#include<math.h>
int main()
{
double x1,y1,x2,y2,s;
while(scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2)!=EOF)
{
s=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
printf("%.2lf\n",s);
}
return 0;
}
相關推薦
人生第一道水題 計算兩點間距離
#include<stdio.h> #include<math.h> int main() { double x1,y1,x2,y2,s; while(scanf("%lf %lf %lf %lf",&x1,&y1,&x
人生中第一道水題 計算兩點間距離
#include<stdio.h> #include <math.h> #include <stdlib.h> int main() { double x1,y1,x2,y2,s; while(scanf
(hdu 簡單題 128道)hdu 2001 計算兩點間的距離
題目:計算兩點間的距離Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 115566 Accepted Subm
人生第一道樹題——cf580C 鏈式前向星,深搜
Kefa decided to celebrate his first big salary by going to the restaurant. He lives by an unusual park. The park is a rooted tree consisting of n vertic
【C++類和物件】計算兩點間距離的兩種方法
使用類的組合(線段Line類中包含點Point類成員): #include <iostream> #include <cmath> using namespace std; //Point類的定義 class Point { public: Po
根據經緯度計算兩點間距離(別問我公式細節,我也沒明白,照搬就行)
import java.util.HashMap; import java.util.Map; public class MapDistance { private static double EARTH_RADIUS = 6378.137
java根據兩個地點的經緯度計算兩點間距離
上程式碼(複製到專案中可直接使用):import java.text.DecimalFormat; /** * @author [email protected] * @date 201
HDU 2001 計算兩點間的距離
scanf 運用 保留 math.sqrt () imp 坐標 sin scrip Problem Description 輸入兩點坐標(X1,Y1),(X2,Y2),計算並輸出兩點間的距離。 Input 輸入數據有多組,每組占一行,由4個實數組成,分別表示x1,y
(字典樹3道水題)codeforces 665E&282E&514C
eps trie sub amp ret sea 動態 應該 signed 665E 題意: 給一個數列和一個整數k,求這個數列中異或起來大於等於k的子串數量。 分析: 其實只要維護一個維護前綴和就行了,把前綴和加到字典樹裏,然後遞歸search一下,註意需要剪枝,
5-3 兩點間距離計算
2.x distance space 重載 生成 數據 使用 函數 結果 給出下面的一個基類框架: class Point_1D { protected: float x;//1D 點的x坐標 public: Point_1D(float p = 0.0); float
來幾道水題 d050: 妳那裡現在幾點了?
names spa clas 卻又 out pan 水題 main ostream 減去15即可(註意這個數小於15的情況) 題目:珊珊到了美國猶他州的楊百翰大學之後,文文禁不住對她的思念,常常想打電話給她,卻又擔心在美國的她是不是在睡覺。好不容易鼓起勇氣打通了電話,第一句
數論——異或,兩道水題。
lld col tps include ons 區間 二進制 統計 但是 第一題:(沒有鏈接) 題目大意:給你n個數(n <= 1000000),第i個數用ai表示(每個a <= 1000000),求出每個數與其之後的數的xor和。 舉個例子吧,比如三個數1
hdu2001 計算兩點間的距離【C++】
script title include rip ++ 組成 tom ali cep 計算兩點間的距離 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)To
1338: 【計算兩點間的距離】
題目描述 輸入兩點座標(X1,Y1),(X2,Y2),計算並輸出兩點間的距離。 輸入 輸入資料有多組,每組佔一行,由4個實陣列成,分別表示x1,y1,x2,y2,資料之間用空格隔開。 輸出 對於每組輸入資料,輸出一行,結果保留兩位小數。
Redis使用GEO計算兩點間的距離
之前在專案中使用了Redis的GEO函式,第一次接觸,所以記錄下來。 首先看下自己專案中的例子,然後後面會帖一個大佬寫的例子。 首先我們需要在pom.xml中引入jar 然後需要配置javaBean 然後就是應用了 try(Jedis jedis = jedisPoo
計算兩點間的距離
Problem Description 輸入兩點座標(X1,Y1),(X2,Y2),計算並輸出兩點間的距離。 Input 輸入資料有多組,每組佔一行,由4個實陣列成,分別表示x1,y1,x2,y2,資料之間用空格隔開。
第一週 水題 第八題
This problem is also a A + B problem,but it has a little difference,you should determine does (a+b) could be divided with 86.For example ,if (A+B)
第一週 水題 第六題
輸入三個字元後,按各字元的ASCII碼從小到大的順序輸出這三個字元。 Input 輸入資料有多組,每組佔一行,有三個字元組成,之間無空格。 Output 對於每組輸入資料,輸出一行,字元中間用一個空格分開。 Sample Input qwe asd zxc Sample Output e q
第一週 水題 第一題
題目:https://vjudge.net/problem/CodeForces-118A 程式碼↓ #include"pch.h" #include #include using namespace std; int main() { int l, a; char word[1000];
第一週 水題 第三題
#include"pch.h" #include using namespace std; int main() { int n, m = 0; cin >> n; char*stone = new char[n]; cin >> stone; –n; while (