Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sum Matrix Main Diagonal
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { // Print 2D Array int [,] intMatrix = new int [3,3] {{1,2,3}, // הגדרת המערך {4,5,6}, {7,8,9}}; int sum=0; for( int row=0; row<intMatrix.GetLength(0); row++) // לולאה לסריקת השורות { sum += intMatrix[row,row]; // סכום } Console.WriteLine(sum); // הדפסה } } }
run
|
edit
|
history
|
help
0
normalised pagination
EFDCSX ASXS
Secure random string
System Convert
Class work
সদফঘজ্যুয়হতগ্রফেদ
For - box
Types
Namespace addition
Split IPs to 8 and 16