CCF CSP 201409-2 画图 (C++)
作者:互联网
#include <iostream>
using namespace std;
struct Rec
{
int x1=0;
int x2=0;
int y1=0;
int y2=0;
};
int a[120][120]= {0};
struct Rec r[1000];
int main()
{
int s=0;
int n;
cin>>n;
int x,y;
for(int i=0; i<n; i++)
{
cin>>r[i].x1>>r[i].y1>>r[i].x2>>r[i].y2;
for(x=r[i].x1; x<r[i].x2; x++)
for(y=r[i].y1; y<r[i].y2; y++)
{
if(a[x][y]==0){
a[x][y]=1;
s++;
}
}
}
cout<<s;
return 0;
}
标签:y2,CCF,struct,int,201409,y1,Rec,x1,CSP 来源: https://blog.csdn.net/weixin_43752106/article/details/114298796