Advertisement
Guest User

Untitled

a guest
May 26th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. #include <iostream>
  2. #include "circle.h"
  3.  
  4. int main() {
  5.     int n = 3;
  6.     Circle *arr = new Circle[n];
  7.  
  8.     arr[0] = Circle(5, 0, 0);
  9.     arr[1] = Circle(3, 0, 0);
  10.     arr[2] = Circle(2, 0, 0);
  11. //    cout << arr[0] << endl;
  12.     CircleArray some(arr, n);
  13.     double *len = some.getLenghts();
  14.     for (int i = 0; i < n; i++) {
  15.         cout << len[i] << " ";
  16.     }
  17.     cout << endl;
  18.     cout << "Index test" << endl;
  19.     for (int i = 0; i < n; i++) {
  20.         Circle cur = some[i];
  21.         cout << cur.radius << " " << cur.x << " " << cur.y << endl;
  22.     }
  23.  
  24.     for (circleIterator it(&some); !it.isEnd(); it++) {
  25.         cout << *it << " ";
  26.     }
  27.     cout << endl;
  28.  
  29.     for (circleIterator it(&some); !it.isEnd(); it++) {
  30.         it.changeLen((it.getCount()+1)*10);
  31.     }
  32.  
  33.     for (circleIterator it(&some); !it.isEnd(); it++) {
  34.         cout << *it << " ";
  35.     }
  36.  
  37.     cout << endl;
  38.     for (int i = 0; i < n; i++) {
  39.         cout << some[i].radius << " ";
  40.     }
  41.     cout << endl;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement