Advertisement
Guest User

paste

a guest
Apr 1st, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <Windows.h>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int n;
  7.  
  8. class Range
  9. {
  10. private:
  11.     double a, b;
  12. public:
  13.     Range()
  14.     {
  15.         cin >> a;
  16.         cin >> b;
  17.     }
  18.     double getLenght()
  19.     {
  20.         return b - a;
  21.     }
  22.     bool isIntersect(const Range& r)
  23.     {}
  24.     float getIntersection(const Range& r)
  25.     {
  26.        
  27.     }
  28.     float getUnion(const Range& r)
  29.     {
  30.  
  31.     }
  32. };
  33.  
  34. Range *arr;
  35. //Range arr[1]; //my shitty crutch
  36.  
  37. void in()
  38. {
  39.    
  40. }
  41. void out()
  42. {
  43.     //for (int i = 0; i < n-1; i++)
  44.     //{
  45.     double c = arr[0].getLenght();
  46.     cout << c;
  47.     //}
  48. }
  49.  
  50. void controller()
  51. {
  52.     Range *arr = new Range[n];
  53.     in();
  54.     out();
  55.     delete[] arr;
  56. }
  57.  
  58. int main()
  59. {
  60.     cin >> n;
  61.     controller();
  62.     system("pause");
  63.     return 0;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement