蒟蒻求助
  • 板块学术版
  • 楼主刘芝麻
  • 当前回复2
  • 已保存回复2
  • 发布时间2020/10/30 22:22
  • 上次更新2023/11/5 09:27:55
查看原帖
蒟蒻求助
208269
刘芝麻楼主2020/10/30 22:22

求助,我在校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

本人本地测试样例已过

2020/10/30 22:22
加载中...