Created
September 16, 2017 15:01
-
-
Save invatainfo/2232f5f7606802089143e5445ad62429 to your computer and use it in GitHub Desktop.
This file contains 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 <fstream> | |
#include <iostream> | |
using namespace std; | |
int main() { | |
int n, a[1000], b[1000], i, j, k; | |
ifstream fin("bac.txt"); | |
fin >> n; | |
for (i = 1; i <= n; i++) | |
fin >> a[i] >> b[i]; | |
for (i = 1; i <= n; i++) { | |
k = 0; | |
for (j = 1; j <= n; j++) | |
if (i != j) | |
if (a[i] > b[j] || a[j] > b[i]) | |
k++; | |
if (k == n - 1) | |
cout << a[i] << " " << b[i] << endl; | |
} | |
fin.close(); | |
system("pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment