Beispiel #1
0
        static void Main(string[] args)
        {
            // DICTONARY KULLANIMI//////////////////////////
            Dictionary <int, string> city = new Dictionary <int, string>();

            city.Add(1, "Adana");
            city.Add(6, "Ankara");
            foreach (KeyValuePair <int, string> sehir in city)
            {
                Console.WriteLine("Plaka:{0} Şehir:{1}", sehir.Key, sehir.Value);
            }
            //////////////////////////////////////////////////


            MyDictonary <int, string> ogrenci = new MyDictonary <int, string>();

            ogrenci.Add(1, "Yağmur");
            Console.WriteLine(ogrenci.Count);
            ogrenci.Add(2, "Aleyna");
            Console.WriteLine(ogrenci.Count);
            ogrenci.Add(10, "Faruk");
            Console.WriteLine(ogrenci.Count);

            foreach (var okul in ogrenci.Value)
            {
                Console.WriteLine(okul);
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            MyDictonary2 <int, string> Ogrenci = new MyDictonary2 <int, string>();

            Ogrenci.Add(123, "Binnaz");
            Ogrenci.Add(124, "Mine");
            Ogrenci.Add(125, "Büşra");

            Console.WriteLine("Boyutu:" + Ogrenci.Count);
            Console.WriteLine(Ogrenci.Values);
            Console.WriteLine(Ogrenci.Key);


            Console.WriteLine("array kullanılarak yapılan kod");
            // ARRAY KULLANARAK KAYIT YAPMAK İÇİN  MyDictonary classını kullanmak gerekli

            MyDictonary <int, string> Ogrenci2 = new MyDictonary <int, string>();

            Ogrenci2.Add(123, "Binnaz");
            Ogrenci2.Add(124, "Mine");
            Ogrenci2.Add(125, "Büşra");

            Console.WriteLine("Boyutu:" + Ogrenci2.Count);
            Console.WriteLine(Ogrenci2.Values);
            Console.WriteLine(Ogrenci2.Key);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            MyDictonary <int, string> animal = new MyDictonary <int, string>();

            animal.Add(01, "Butterfly");
            animal.Add(02, "Rabbit");
            animal.Add(03, "Cat");
            animal.Add(04, "Turtle");
            animal.Add(05, "Dog");
            animal.Add(06, "Owl");
            animal.Add(07, "Lion");
            animal.Add(08, "Panda");
            animal.Add(09, "Dolphin");
            animal.Add(10, "Bear");
            animal.Add(11, "Bird");
            animal.Add(12, "Fish");


            foreach (var number in animal.Keys)
            {
                Console.WriteLine(number);
            }

            foreach (var hayvan in animal.Values)
            {
                Console.WriteLine(hayvan);
            }
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            MyDictonary <int, string> myDictonary = new MyDictonary <int, string>();

            myDictonary.Add(1, "Hamza");
            myDictonary.Add(2, "Özgür");
            myDictonary.Add(3, "Burak");
            Console.WriteLine(myDictonary.Count);
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            MyDictonary <string> words = new MyDictonary <string>();

            words.Add("Country");
            words.Add("Apple");
            words.Add("Travel");

            words.Listele();
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            MyDictonary <int, string> Book = new MyDictonary <int, string>();

            Book.Add(1, "Bir Ömür Nasıl Yaşanır?");
            Book.Add(2, "Pia Matter");
            Book.Add(3, "Kardeşimin Hikayesi");

            Console.WriteLine(Book.Count);
        }
Beispiel #7
0
        static void Main(string[] args)
        {
            MyDictonary <int, string> products = new MyDictonary <int, string>();

            products.Add(1, "masa");
            products.Add(2, "bilgisayar");
            products.Add(3, "koltuk");

            Console.WriteLine(products.Count);
        }
Beispiel #8
0
        static void Main(string[] args)
        {
            MyDictonary <string, int> myDictonary = new MyDictonary <string, int>();

            myDictonary.Add("Amy", 8);
            myDictonary.Add("Jake", 5);
            myDictonary.Add("Terry", 10);

            Console.WriteLine(myDictonary.CountKey);
            Console.WriteLine(myDictonary.CountValue);
        }
Beispiel #9
0
        static void Main(string[] args)
        {
            MyDictonary <string> isim = new MyDictonary <string>();

            isim.Add("Deha");
            Console.WriteLine(isim.Lenght);
            isim.Add("Nazım");
            Console.WriteLine(isim.Lenght);
            foreach (var isimler in isim.Items)
            {
                Console.WriteLine(isimler);
            }
        }
Beispiel #10
0
        static void Main(string[] args)
        {
            List <string> ogrenciler = new List <string>();

            ogrenciler.Add("Çağlar");
            ogrenciler.Add("Yaren");
            ogrenciler.Add("Aslı");
            ogrenciler.Add("Cihan");
            ogrenciler.Add("Engin");
            Console.WriteLine(ogrenciler.Count);


            MyDictonary <string> ogrenciler1 = new MyDictonary <string>();

            ogrenciler1.Add("İLHAMİ");
            ogrenciler1.Add("Yasin");
            ogrenciler1.Add("Yunus");
            ogrenciler1.Add("Berkay");
            ogrenciler1.Add("Talha");
            ogrenciler1.Add("Eyüp");
            Console.WriteLine(ogrenciler1.Count);
        }
Beispiel #11
0
        static void Main(string[] args)
        {
            Dictionary <string, int> sehirler = new Dictionary <string, int> ();

            sehirler.Add("Ankara", 06);
            sehirler.Add("Zonguldak", 67);

            foreach (var item in sehirler)
            {
                Console.WriteLine(item);
            }

            Console.WriteLine(sehirler.Count);

            MyDictonary <string, int> sehirler2 = new MyDictonary <string, int>();

            sehirler2.Add("Istanbul", 34);
            sehirler2.Add("Bolu", 14);
            sehirler2.Add("Izmit", 41);



            Console.ReadLine();
        }
Beispiel #12
0
        static void Main(string[] args)
        {
            MyDictonary <int, string> clubs = new MyDictonary <int, string>();

            clubs.Add(01, "Barcelona");
            clubs.Add(02, "Real Madrid");
            clubs.Add(03, "Mallorca");
            clubs.Add(04, "İnter");
            clubs.Add(05, "Milan");
            clubs.Add(06, "Juventus");
            clubs.Add(07, "Atletico Madrid");
            clubs.Add(08, "Roma");

            foreach (var club in clubs.Values)
            {
                Console.WriteLine(club);
            }
            foreach (var numbers in clubs.Keys)
            {
                Console.WriteLine(numbers);
            }

            Console.ReadLine();
        }