没用过数组,竟然全报错?
查看原帖
没用过数组,竟然全报错?
1563561
liyixin2405221216楼主2024/11/21 21:34
#include<iostream>
using namespace std;

int main() {
	int w, x, h;
	cin >> w >> x >> h;
	int q;
	cin >> q;
	int sum = w * x * h;
	for (int i = 0; i < q; i++) {
		int x1, y1, z1, x2, y2, z2;
		cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
		int x = x2 - x1 + 1; int y = y2 - y1 + 1; int z = z2 - z1 + 1;
		int area = x * y * z;
		sum -= area;
	}
	cout << sum;
}
2024/11/21 21:34
加载中...