标签:des blog http ar io os sp for java
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 5422 Accepted Submission(s): 2466
#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<cmath> #include<algorithm> #include<cstdlib> #include<queue> #include<vector> #include<set> using namespace std; int n,x[1010],y[1010]; bool flag; int main() { while(scanf("%d",&n)!=EOF) { flag=false; if(n==0) break; for(int i=0;i<n;i++) scanf("%d%d",&x[i],&y[i]); x[n]=x[0],y[n]=y[0],x[n+1]=x[1],y[n+1]=y[1]; for(int i=0;i<n;i++) { if(((x[i]-x[i+1])*(y[i+1]-y[i+2])-(y[i]-y[i+1])*(x[i+1]-x[i+2]))<0) { flag=true; break; } } if(flag) printf("concave\n"); else printf("convex\n"); } return 0; }
标签:des blog http ar io os sp for java
原文地址:http://www.cnblogs.com/a972290869/p/4166258.html