#include "IntervalIntersections.cpp" int main(int argc, char **argv) { int i; class IntervalIntersections TheClass; int retval; int x1; int y1; int x2; int y2; if (argc != 2) { fprintf(stderr, "usage: a.out num\n"); exit(1); } /* x1 = ; y1 = ; x2 = ; y2 = ; */ if (atoi(argv[1]) == 0) { x1 = 3; y1 = 6; x2 = 1; y2 = 2; } if (atoi(argv[1]) == 1) { x1 = 1; y1 = 2; x2 = 3; y2 = 6; } if (atoi(argv[1]) == 2) { x1 = 1; y1 = 10; x2 = 2; y2 = 5; } if (atoi(argv[1]) == 3) { x1 = 4; y1 = 5; x2 = 1; y2 = 4; } if (atoi(argv[1]) == 4) { x1 = 1; y1 = 1; x2 = 1000000; y2 = 1000000; } retval = TheClass.minLength(x1, y1, x2, y2); cout << retval << endl; exit(0); }