using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication10 { class AnaSinif { public AnaSinif(){ MessageBox.Show("İşlemler Sınıfı"); } struct a{ public string karakter;// Forma 1 Adet Textbox Konuluıp Bu değer karakter değişkenine Atılacak public int sayi1;// Forma 1 Adet Textbox Konuluıp Bu değer sayi1 değişkenine Atılacak public int sayi2;// Forma 1 Adet Textbox Konuluıp Bu değer sayi2 değişkenine Atılacak } } class Cocuk1 : AnaSinif { private int[,] tamsayi1 = new int[10, 2] {{40,75}, {65,35}, {55,55}, {65,85}, {45,35}, {15,30}, {70,90}, {85,36} {70,63}, {11,25}, {58,48}, {25,84}, {54,35}, {51,12}, {19,91}, {66,63} }; private int[,] tamsayi2 = new int[10, 2] {{40,75}, {65,35}, {55,55}, {65,85}, {45,35}, {15,30}, {70,90}, {85,36} {70,63}, {11,25}, {58,48}, {25,84}, {54,35}, {51,12}, {19,91}, {66,63} }; AnaSinif asn = new AnaSinif(); public int globaltoplam = 0; public int satır_toplam = 0; public int sutun_toplam = 0; public Cocuk1 { MessageBox.Show(as.karakter.ToString()); } public function hesapla() { for (int m = 0; m < 10; m++) { int sutun_toplam=0; int satır_toplam = 0; for (int n = 0; n < 10; n++) { satır_toplam += tamsayi1[m, n]; sutun_toplam+=tamsayi2[m, n]; } } } } class Cocuk2:AnaSinif { private int[,] rakamlar = new int[10, 2] {{40,75}, {65,35}, {55,55}, {65,85}, {45,35}, {15,30}, {70,90}, {85,36} {70,63}, {11,25}, {58,48}, {25,84}, {54,35}, {51,12}, {19,91}, {66,63} }; private int[,] A = new int[10, 2] {{40,75}, {65,35}, {55,55}, {65,85}, {45,35}, {15,30}, {70,90}, {85,36} {70,63}, {11,25}, {58,48}, {25,84}, {54,35}, {51,12}, {19,91}, {66,63} }; private int[,] B = new int[10, 2] {{40,75}, {65,35}, {55,55}, {65,85}, {45,35}, {15,30}, {70,90}, {85,36} {70,63}, {11,25}, {58,48}, {25,84}, {54,35}, {51,12}, {19,91}, {66,63} }; AnaSinif as = new AnaSinif(); public int toplam = 0; public Cocuk2 { toplam = as.sayi1 + as.sayi2; MessageBox.Show(toplam.ToString()); } public function hesapla() { // A nın satır sayısı kadar for (int i = 0; i <= A.GetUpperBound(0); i++) { // B nin sütun sayısı kadar for (int j = 0; j <= B.GetUpperBound(1); j++) { int toplam = 0; // A nın sütun sayısı kadar // (ya da B nin satır sayısı) for (int k = 0; k <= A.GetUpperBound(1); k++) { toplam += A[i, k] * B[k, j]; } C[i, j] = toplam; } } } new public function yazdir() { Cocuk1 c1 = new Cocuk1(); c1.hesapla(); MessageBox.Show(c1.satır_toplam,c1.sutun_toplam).ToString(); MessageBox.Show(hesapla()).ToString(); //Ekrana Yazdıran Method MessageBox.Show("Rakamlar"); for (int satir = 0; satir < rakamlar.GetLength(0); satir++) { //Rectangular dizi içindeki sütunlar arasında dönecek döngümüzü oluşturuyorum for (int sutun = 0; sutun < rakamlar.GetLength(1); sutun++) { MessageBox.Show("{0} ", rakamlar[satir, sutun]); } MessageBox.Show(""); //boş satır } // Döngü sonu } } }