11 Temmuz 2011 Pazartesi

C# İki Boyutlu Diziler

using System;
 using System.Collections.Generic;
 using System.Text;

 namespace ConsoleApplication1
 {
 class Program
 {
 static void Main(string[] args)
 {
 // İki boyutlu dizinin elemanlarının ekrana yazdırılması

 int[,] not = new int[2,3];

 not[0, 0] = 100;
 not[0, 1] = 40;
 not[0, 2] = 25;
 not[1, 0] = 50;
 not[1, 1] = 80;
 not[1, 2] = 60;

 for (int i = 0; i < 2; i++)
 {
 for (int j = 0; j < 3; j++) Console.Write("{0} ", not[i, j]);
 Console.WriteLine();
 }

 }
 }
 }

1 yorum: