diff --git a/Program.cs b/Program.cs index 5691651..a8ee0db 100644 --- a/Program.cs +++ b/Program.cs @@ -20,7 +20,7 @@ class Program { Console.WriteLine("4. Prodotto diagonale secondaria"); Console.WriteLine("5. Valore minimo e massimo diagonale secondaria"); Console.WriteLine("6. Somma 2 matrici"); - Console.WriteLine("7. MOstra matrice trasposta"); + Console.WriteLine("7. Mostra matrice trasposta"); Console.WriteLine("0. Esci"); Console.Write("Scelta: "); scelta = Convert.ToInt32(Console.ReadLine()); @@ -91,33 +91,10 @@ class Program { break; case 7: Console.Clear(); - if (matrix1 != null) { - if (true) { - Console.WriteLine("Sulla diagonale principale sono presenti degli zeri"); - } - else { - Console.WriteLine("Sulla diagonale principale non sono presenti degli zeri"); - } - } - else { - Console.WriteLine("È necessario creare la matrice prima di cercare gli zeri sulla diagonale principale."); - } - Pausa(); - break; - case 8: + matrix1 = CreaMatrice(); Console.Clear(); - if (matrix1 != null) { - Console.Write("Inserire un numero da cercare: "); - if (true) { - Console.WriteLine("Elemento trovato"); - } - else { - Console.WriteLine("Elemento non trovato"); - } - } - else { - Console.WriteLine("È necessario creare la matrice prima di cercare un elemento sulla diagonale principale."); - } + Console.WriteLine("La matrice trasposta è"); + MostraMatrice(CreaTrasposta(matrix1)); Pausa(); break; default: @@ -274,4 +251,14 @@ class Program { } return ritorno; } + + static int[,] CreaTrasposta(int[,] p_matrice) { + int[,] ritorno = new int[p_matrice.GetLength(0), p_matrice.GetLength(1)]; + for (int r = 0; r < p_matrice.GetLength(0); r++) { + for (int c = 0; c < p_matrice.GetLength(1); c++) { + ritorno[r, c] = p_matrice[c, r]; + } + } + return ritorno; + } } diff --git a/bin/Debug/net9.0/matrix_3.dll b/bin/Debug/net9.0/matrix_3.dll index c482492..4688e1e 100644 Binary files a/bin/Debug/net9.0/matrix_3.dll and b/bin/Debug/net9.0/matrix_3.dll differ diff --git a/bin/Debug/net9.0/matrix_3.pdb b/bin/Debug/net9.0/matrix_3.pdb index c0606ba..67d2791 100644 Binary files a/bin/Debug/net9.0/matrix_3.pdb and b/bin/Debug/net9.0/matrix_3.pdb differ diff --git a/obj/Debug/net9.0/matrix_3.AssemblyInfo.cs b/obj/Debug/net9.0/matrix_3.AssemblyInfo.cs index 09652fa..1e25809 100644 --- a/obj/Debug/net9.0/matrix_3.AssemblyInfo.cs +++ b/obj/Debug/net9.0/matrix_3.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("matrix_3")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b00a9cea811f930eff832555c7d39711548491f2")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+539f1a7b8c9a68722f7a1fe86ab352245f0386bf")] [assembly: System.Reflection.AssemblyProductAttribute("matrix_3")] [assembly: System.Reflection.AssemblyTitleAttribute("matrix_3")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net9.0/matrix_3.AssemblyInfoInputs.cache b/obj/Debug/net9.0/matrix_3.AssemblyInfoInputs.cache index fd79203..f9cf85d 100644 --- a/obj/Debug/net9.0/matrix_3.AssemblyInfoInputs.cache +++ b/obj/Debug/net9.0/matrix_3.AssemblyInfoInputs.cache @@ -1 +1 @@ -24011d8278f0ee5fff0d76f8ca60ae6d36888403cf7bf503a41a322503a8e8e7 +75d0e1c096fd43eafc2a6b5b20efe325c46b0abfa9de25105e4bd04279227414 diff --git a/obj/Debug/net9.0/matrix_3.dll b/obj/Debug/net9.0/matrix_3.dll index c482492..4688e1e 100644 Binary files a/obj/Debug/net9.0/matrix_3.dll and b/obj/Debug/net9.0/matrix_3.dll differ diff --git a/obj/Debug/net9.0/matrix_3.pdb b/obj/Debug/net9.0/matrix_3.pdb index c0606ba..67d2791 100644 Binary files a/obj/Debug/net9.0/matrix_3.pdb and b/obj/Debug/net9.0/matrix_3.pdb differ diff --git a/obj/Debug/net9.0/ref/matrix_3.dll b/obj/Debug/net9.0/ref/matrix_3.dll index 480e259..8fae9d4 100644 Binary files a/obj/Debug/net9.0/ref/matrix_3.dll and b/obj/Debug/net9.0/ref/matrix_3.dll differ diff --git a/obj/Debug/net9.0/refint/matrix_3.dll b/obj/Debug/net9.0/refint/matrix_3.dll index 480e259..8fae9d4 100644 Binary files a/obj/Debug/net9.0/refint/matrix_3.dll and b/obj/Debug/net9.0/refint/matrix_3.dll differ