예제 #1
0
        static void Main(string[] args)
        {
            int Count;
            int i;
            int exp, co;
            Node a = new Node(), b = new Node();
            Node result = new Node();

            Count = Convert.ToInt32(Console.ReadLine());
            for (i = 0; i < Count; i++)
            {
                co = Convert.ToInt32(Console.ReadLine());
                exp = Convert.ToInt32(Console.ReadLine());
                a.Read(co, exp);
            }

            Count = Convert.ToInt32(Console.ReadLine());
            for (i = 0; i < Count; i++)
            {
                co = Convert.ToInt32(Console.ReadLine());
                exp = Convert.ToInt32(Console.ReadLine());
                b.Read(co, exp);
            }

            result = a + b;
            result.Print();
        }
예제 #2
0
 public void Read(int co,int exp)
 {
     Last.Next = new Node();
     Last = Last.Next;
     Last.Coefficient = co;
     Last.Exponent = exp;
     Last.Next = null;
 }
예제 #3
0
        public static Node operator +(Node a, Node b)
        {
            Node result = new Node();

            return result;
        }
예제 #4
0
 public Node()
 {
     Next = null;
     Last = this;
     Coefficient = Exponent = 0;
 }