赞
踩
201409-2 画图
#include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 110; int n; bool a[N][N]; int main() { scanf("%d", &n); while (n--) { int x1, y1, x2, y2; scanf("%d%d%d%d", &x1, &y1, &x2, &y2); for (int i = x1; i < x2; i++) for (int j = y1; j < y2; j++) a[i][j] = true; } int cnt = 0; for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) if (a[i][j]) cnt++; printf("%d\n", cnt); return 0; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。