Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- using namespace std;
- vector <Segment> v;
- int n;
- Point kit[333];
- struct Point {
- int x;
- int y;
- Point(int _x, int _y) {
- x = _x;
- y = _y;
- }
- Point() {}
- bool operator ==(Point G) {
- if (G.x == x&&G.y == y) return 1;
- else return 0;
- }
- bool operator !=(Point G) {
- if (G.x != x || G.y != y) return 1;
- else return 0;
- }
- };
- struct Segment {
- Point a;
- Point b;
- int numbering = 0;
- Segment() {}
- Segment(Point _a, Point _b) {
- a = _a;
- b = _b;
- }
- };
- bool comparator(Point a, Point b) {
- return a.x < b.x;
- }
- istream& operator >> (istream& cin, Point &A) {
- cin >> A.x >> A.y;
- return cin;
- }
- ostream& operator << (ostream& cin, Point &A) {
- cin << A.x << ' ' << A.y << endl;
- return cin;
- }
- void read_out() {
- for (int i = 0; i < n; i++) {
- for (int j = i + 1; j < n; j++) {
- v.a.push_back(kit[i]);
- v.b.push_back(kit[j]);
- }
- }
- }
- void under_the_cut() {
- for (int i = 0; i < v.size(); i++) {
- co = 0;
- for (int j = 0; j < n; j++) {
- if ((Segment[i].a.x < kit[j].x && kit[j].x < Segment[i].b.x) || (Segment[i].a.x > kit[j].x && kit[j].x > Segment[i].b.x)) {
- Segment[i].numbering++;
- }
- }
- }
- }
- int main() {
- cin >> n;
- for (int i = 0; i < n; i++)cin >> kit[i];
- read_out();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement