Created
April 21, 2018 07:07
-
-
Save lovasoa/8588632c38aef8110a984d5300e69876 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
bool in(int x, int y, int x1, int x2, int y1, int y2){ | |
return x1<=x && x<=x2 | |
&& y1<=y && y<=y2; | |
} | |
int main() | |
{ | |
int x1,x2,y1,y2,a1,a2,b1,b2; | |
cin>>x1>>y1>>x2>>y2>>a1>>b1>>a2>>b2; | |
for(int x=0;x<10;x++){ | |
for(int y=0;y<30;y++){ | |
bool inxy = in(x, y, x1, x2, y1, y2); | |
bool inab = in(x, y, a1, a2, b1, b2); | |
cout << (inab&&inxy ? 3 | |
: inxy ? 1 | |
: inab ? 2 | |
: 0); | |
} | |
cout << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment