PersonalCorpus 版 (精华区)
1029771 Big Guava ... 476 Accepted 0:00.070
400 2002/08/19 07:23:46.395
double multi(double a, double b, double c, double d, double e, double
f)
{
return (c-a)*(f-b)-(e-a)*(d-b);
}
void main()
{
double f[100][6];
char fm[100];
double a,b;
int i,j,k;
char s[100];
bool flag;
k=0;
while (1) {
gets(s);
if (strcmp(s,"*")==0) break;
fm[k]=s[0];
if (fm[k]=='r')
sscanf(s+2,"%lf%lf%lf%lf",&f[k][0],&f[k][1],&f[k][2],
&f[k][3]);
k++;
}
j=1;
while (scanf("%lf%lf\n",&a,&b)==2) {
if ((a==9999.9)&&(b==9999.9)) break;
flag=true;
for (i=0;i<k;i++)
if (fm[i]=='r')
if
((f[i][0]<a)&&(f[i][2]>a)&&(f[i][1]>b)&&(f[i][3]<b)) {
printf("Point %d is contained in figure %d\n",j,
i+1);
flag=false;
}
if (flag) printf("Point %d is not contained in any figure\n",
j);
j++;
}
}
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.093毫秒