0pts求调(壶关)
查看原帖
0pts求调(壶关)
995569
L__B楼主2025/8/3 21:24
#include<bits/stdc++.h>
using namespace std;
int n,x1,y,x2,y2,a[101][101],s;
int main(){
    scanf("%d",&n);
    while(n--){
        scanf("%d%d%d%d",&x1,&y,&x2,&y2);
        for(int i=y;i<=y2;i++)
          for(int j=x1;j<=x2;j++)
            a[i][j]=1;
    }
    for(int i=0;i<101;i++)
      for(int j=0;j<101;j++)
        if(a[i][j]) s++;
    printf("%d",s);
    return 0;
}
2025/8/3 21:24
加载中...