求助,我在校OJ里提交的程序呈现出这种鬼一样的编译错误,求犇犇解释orz orz orz otz otz
代码:
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
int x1,x2,y1,y2,a1,b1,a2,b2,sum,s,a,b,c,d;
int main()
{
cin>>x1>>y1>>x2>>y2;
cin>>a1>>b1>>a2>>b2;
if (a1<=x1&&b1<=y1){s++;a=1;}
if (x2<=a2&&y1>=b1){s++;b=1;}
if (x2<=a2&&y2<=b2){s++;c=1;}
if (a1<=x1&&b2>=y2){s++;d=1;}
if (s==4) printf("0");
else if (s==0||s==1) printf("%d",(x1-x2)*(y1-y2));
else
{
if (a&&b) sum=(x2-x1)*(y2-b2);
if (b&&c) sum=(a1-x1)*(y2-y1);
if (c&&d) sum=(x2-x1)*(b1-y1);
if (d&&a) sum=(x2-a2)*(y2-y1);
printf("%d",sum);
}
return 0;
}
样例输入:
2 1 7 4
5 1 10 3
样例输出:
15
本人本地测试样例已过