标签:
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 5984 Accepted Submission(s): 2745
4 0 0 1 0 1 1 0 1 0
convex 海东集团终于顺利成立了!后面的路,他们会顺顺利利吗? 欲知后事如何,且听下回分解——
<span style="font-size:12px;">#include<cstdio> struct node { int x,y; }vige[1000]; int tubao(int a,int b,int c) { int z; z=(vige[a].x-vige[c].x)*(vige[b].y-vige[c].y)-(vige[b].x-vige[c].x)*(vige[a].y-vige[c].y); return z; } int main() { int n,i,t; while(scanf("%d",&n)&&n) { for(i=0;i<n;++i) scanf("%d%d",&vige[i].x,&vige[i].y); for(i=0;i<n;++i) { t=tubao(i%n,(i+1)%n,(i+2)%n);//判断n个点,最后的点要取开头的点比较 if(t<-1) break; } if(t>=0) printf("convex\n"); else printf("concave\n"); } return 0; }</span>
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/zwj1452267376/article/details/47754643