201409-2 画图
实现
#include <cstdio>
#define MAX_SIZE 0x70
int map[MAX_SIZE][MAX_SIZE];
int main() {
int num_triangle;
scanf("%d",&num_triangle);
for (int i = 0;i < num_triangle;++i) {
int x1, y1, x2, y2;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
for (int j = x1;j < x2;++j) {
for (int k = y1;k < y2;++k) {
map[j][k] = 1;
}
}
}
int res = 0;
for (int i = 0;i < MAX_SIZE;++i) {
for (int j = 0;j < MAX_SIZE;++j) {
res += map[i][j];
}
}
printf("%d\n",res);
}