题目来源:码蹄集
https://matiji.net/exam/brushquestion/176/778/B3FCFEC101BD05189BB74D522E019504
参考程序:
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
using namespace std;
#define N 1000
#define ll long long
double x[10],y[10] ;
int main(){
cin >> x[1] >> y[1] >> x[2] >> y[2];
ll ans = (x[1] - x[2])*(x[1] - x[2]) + (y[1] - y[2])*(y[1] - y[2]) ;
int i = sqrt(ans) ;
if(i*i == ans){
cout << i ;
}
else cout << i + 1;
return 0;
}