改正我愚蠢的错误
This commit is contained in:
parent
406d2a973d
commit
4e67975b9b
|
@ -2,7 +2,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
struct zb {
|
struct zb {
|
||||||
int x, y;
|
float x, y;
|
||||||
} a, b;
|
} a, b;
|
||||||
|
|
||||||
float dis(struct zb a, struct zb b) {
|
float dis(struct zb a, struct zb b) {
|
||||||
|
@ -10,12 +10,7 @@ float dis(struct zb a, struct zb b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
scanf("%d%d%d%d", &a.x, &a.y, &b.x, &b.y);
|
scanf("%f%f%f%f", &a.x, &a.y, &b.x, &b.y);
|
||||||
// printf("%d%d%d%d", a.x, a.y, b.x, b.y);
|
printf("%f", dis(a, b));
|
||||||
if(a.x == 1 && a.y == 0 && b.x == 0 && b.y == 0){
|
|
||||||
printf("1.000000");
|
|
||||||
// 绷不住了,输出什么都不对,只能这样了
|
|
||||||
}
|
|
||||||
else printf("%f", dis(a, b));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Reference in New Issue