样例可以一提交WA怎么办
我的代码:
#include <bits/stdc++.h>
using namespace std;
int x[3], y[3], dis[3];
double ans;
int main()
{
cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
dis[0] = sqrt((x[1] - x[0]) * (x[1] - x[0]) + (y[1] - y[0]) * (y[1] - y[0]));
dis[1] = sqrt((x[2] - x[1]) * (x[2] - x[1]) + (y[2] - y[1]) * (y[2] - y[1]));
dis[2] = sqrt((x[0] - x[2]) * (x[0] - x[2]) + (y[0] - y[2]) * (y[0] - y[2]));
ans = 1.00 * (dis[0] + dis[1] + dis[2]);
printf("%.2lf", ans);
return 0;
}
在样例测试的时候明显是12.00,可一提交却发现是WA,请问怎么办?