Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int first, second, third, forth; //,output1, ;
- scanf("%d %d %d %d", &first, &second, &third, &forth);
- if (first >= third) { //case 2,4,5,6,8
- if (second <= forth && first <= forth) { // case 2
- printf("[%d,%d]\n", first, second);
- }
- if (first < forth && second > forth) { // case 4
- printf("[%d,%d]\n", first, forth);
- }
- if (forth < first && forth < second) { // case 8
- printf("[]\n" );
- }
- }
- if (third > first) { //case 1,3,7
- if (second >= third && forth >= second) { //case 1
- printf("[%d,%d]\n", third, second );
- }
- if (second > third && second > forth) { //case 3
- printf("[%d,%d]\n",third, forth );
- }
- if (second < third && second < forth) { //case 7
- printf("[]\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement