コード例 #1
0
int main() {
	while (~scanf("%d", &hull.n)) {
		for (int i = 0; i < hull.n; i++)
			scanf("%lf%lf%lf", &hull.P[i].x, &hull.P[i].y, &hull.P[i].z);
		hull.construct();
		printf("%d\n", hull.facetCnt());
	}
	return 0;
}
コード例 #2
0
int main(){
	int tc;
	scanf("%d", &tc);
	for (int t = 1; t <= tc; t++){
		scanf("%d", &hull.n);
		for (int i = 0; i < hull.n; i++)
			scanf("%lf%lf%lf", &hull.P[i].x, &hull.P[i].y, &hull.P[i].z);
		hull.construct();
        printf("Case %d: %d\n", t, hull.facetCnt());
	}
	return 0;
}
コード例 #3
0
ファイル: 1010.cpp プロジェクト: mzry1992/workspace
int main()
{
    while (true)
    {
        scanf("%d",&hull.n);
        if (hull.n == 0)    break;
        for (int i = 0;i < hull.n;i++)
            scanf("%lf%lf%lf",&hull.P[i].x,&hull.P[i].y,&hull.P[i].z);
        hull.construct();
        int q;
        scanf("%d",&q);
        for (int i = 0;i < q;i++)
        {
            pt p;
            scanf("%lf%lf%lf",&p.x,&p.y,&p.z);
            printf("%.4f\n",hull.nearstpoint(p));
        }
    }
    return 0;
}