AcWing每日一题--画图

https://www.acwing.com/problem/content/3206/

水题。

 1 #include<iostream>
 2 using namespace std;
 3 bool st[110][110];
 4 int main(void){
 5     int n;
 6     cin>>n;
 7     for(int i=0;i<n;i++){
 8         int x1,y1,x2,y2;
 9         cin>>x1>>y1>>x2>>y2;
10         for(int j=x1+1;j<=x2;j++){
11             for(int k=y1+1;k<=y2;k++){
12                 st[j][k]=true;
13             }
14         }
15     }
16     int res=0;
17     for(int i=0;i<N;i++){
18         for(int j=0;j<N;j++){
19             if(st[i][j])
20                 res++;
21         }
22     }
23     cout<<res;
24     return 0;
25 }
原文地址:https://www.cnblogs.com/greenofyu/p/14555857.html