daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace lab3_zad1
  7. {
  8.     public class List
  9.     {
  10.         List next;
  11.         public object val;
  12.  
  13.         public void Add(object val)
  14.         {
  15.             if (next != null) { next.Add(val); }
  16.             else
  17.             {
  18.                 this.next = new List();
  19.                 this.next.val = val;
  20.             }
  21.         }
  22.         public object Top() { return this.val; }
  23.  
  24.     }
  25.     class Program
  26.     {
  27.         static void Main(string[] args)
  28.         {
  29.             List l = new List();
  30.             l.Add(497387);
  31.             l.Add(8);
  32.             Console.WriteLine(l.Top());
  33.         }
  34.     }
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top