Compare commits

...

3 Commits

Author SHA1 Message Date
flykhan 51edac9f6d 两点间的距离 2023-03-24 11:18:32 +08:00
flykhan 9341a66cab 修改git忽略规则 2023-03-24 11:07:06 +08:00
flykhan e749379ab0 油耗 2023-03-24 10:55:54 +08:00
3 changed files with 24 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
**/*.exe **/*.exe
**/gmon.out **/*.out

View File

@ -0,0 +1,12 @@
#include <cstdio>
using namespace std;
int main()
{
int x;
float y;
scanf("%d%f", &x, &y);
printf("%.3f km/l", x / y);
return 0;
}

View File

@ -0,0 +1,11 @@
#include <cstdio>
#include <cmath>
int main()
{
double x1, y1, x2, y2;
scanf("%lf%lf", &x1, &y1);
scanf("%lf%lf", &x2, &y2);
printf("%.4lf\n",sqrt(pow((x1-x2),2)+pow((y1-y2),2)));
return 0;
}