Exemple #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();
        }
Exemple #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;
 }
Exemple #3
0
        public static Node operator +(Node a, Node b)
        {
            Node result = new Node();

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