//exercise: circular lined list
#include <iostream>
using namespace std;

class List;
class ListIterator;
class Node {
 friend class List;
 friend class ListIterator;
 float coef;
 int exp;
 Node* link;

class List {
 friend class ListIterator;
 Node* first;
 List();//생성자가 head node 를 생성
 List& addList(List&);
 void addNode(float, int);
 void showList();

class ListIterator {
 ListIterator(const List& l) :list(l), current(l.first) {};
 //dereferencing operators
 float& operator *() const { return current->coef; }
 int * operator->()const { return &current->exp; }
 ListIterator& operator ++(); //preincrement
 ListIterator operator ++(int); //post increment
 bool NotNull(); //check the current element in list is non-null
 bool NextNotNull();//check the next element in list is non-null

 Node* First();     //return a pointer to the first element of list
 Node* Next();  //return a pointer to the next element of list
 const List& list; //refers to an existing list
 Node* current; //points to a node in list

int main(void)
 List a1, a2;
 MakeList(a1);//지수와 계수를 입력하여 처리
 //cout <<a1;
 //cout << a2
 List a3 = a1.addList(a2);
 //cout << a3;
 return 1;