diff --git a/Program.cs b/Program.cs index 7710870..a9b0ea4 100644 --- a/Program.cs +++ b/Program.cs @@ -31,13 +31,7 @@ class Program { break; case 2: Console.Clear(); - Console.Write("Inserire una frase: "); - //if (Palindromo(Console.ReadLine())) { - Console.WriteLine("La frase è palindroma"); - //} - //else { - Console.WriteLine("La frase non è palindroma"); - //} + Console.WriteLine(Codifica()); Pausa(); break; case 3: @@ -108,4 +102,35 @@ class Program { } Console.WriteLine(); } + + static string Codifica() { + string stringa = Input(); + char codice = 'f'; + const char inutile = '\\'; + char[] ritorno = new char[stringa.Length * 2]; + Array.Fill(ritorno, inutile); + char[] vocali = { 'a', 'e', 'i', 'o', 'u' }; + int k = 0; + + + for (int i = 0; i < stringa.Length; i++) { + ritorno[k] = stringa[i]; + for (int j = 0; j < vocali.Length; j++) { + if (stringa[i] == vocali[j]) { + k++; + ritorno[k] = codice; + break; + } + else if (stringa[i] == char.ToUpper(vocali[j])) { + k++; + ritorno[k] = char.ToUpper(codice); + break; + } + } + k++; + + } + + return string.Join("", ritorno).Split(inutile).First(); + } } diff --git a/bin/Debug/net9.0/strings_3.dll b/bin/Debug/net9.0/strings_3.dll index 88273a9..2ffa3d7 100644 Binary files a/bin/Debug/net9.0/strings_3.dll and b/bin/Debug/net9.0/strings_3.dll differ diff --git a/bin/Debug/net9.0/strings_3.pdb b/bin/Debug/net9.0/strings_3.pdb index 0c5c070..692d0d0 100644 Binary files a/bin/Debug/net9.0/strings_3.pdb and b/bin/Debug/net9.0/strings_3.pdb differ diff --git a/obj/Debug/net9.0/ref/strings_3.dll b/obj/Debug/net9.0/ref/strings_3.dll index e9a57e2..1cb1859 100644 Binary files a/obj/Debug/net9.0/ref/strings_3.dll and b/obj/Debug/net9.0/ref/strings_3.dll differ diff --git a/obj/Debug/net9.0/refint/strings_3.dll b/obj/Debug/net9.0/refint/strings_3.dll index e9a57e2..1cb1859 100644 Binary files a/obj/Debug/net9.0/refint/strings_3.dll and b/obj/Debug/net9.0/refint/strings_3.dll differ diff --git a/obj/Debug/net9.0/strings_3.AssemblyInfo.cs b/obj/Debug/net9.0/strings_3.AssemblyInfo.cs index 18261e7..31f574e 100644 --- a/obj/Debug/net9.0/strings_3.AssemblyInfo.cs +++ b/obj/Debug/net9.0/strings_3.AssemblyInfo.cs @@ -13,10 +13,10 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("strings_3")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f7c77cc677e2aad807832fec2775b0341e41ffd3")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d29d204ee494646ce5094700197a900b05cc44aa")] [assembly: System.Reflection.AssemblyProductAttribute("strings_3")] [assembly: System.Reflection.AssemblyTitleAttribute("strings_3")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] -// Generated by the MSBuild WriteCodeFragment class. +// Generato dalla classe WriteCodeFragment di MSBuild. diff --git a/obj/Debug/net9.0/strings_3.AssemblyInfoInputs.cache b/obj/Debug/net9.0/strings_3.AssemblyInfoInputs.cache index aefbe2c..96b12b6 100644 --- a/obj/Debug/net9.0/strings_3.AssemblyInfoInputs.cache +++ b/obj/Debug/net9.0/strings_3.AssemblyInfoInputs.cache @@ -1 +1 @@ -437b533b5127f5b1e5d132098240dac87416d889e2ff513387be247f3341bce6 +cbb955859c30d97643b375ba8ca1883b485f554c16cef8a828a4aa0bf8968236 diff --git a/obj/Debug/net9.0/strings_3.dll b/obj/Debug/net9.0/strings_3.dll index 88273a9..2ffa3d7 100644 Binary files a/obj/Debug/net9.0/strings_3.dll and b/obj/Debug/net9.0/strings_3.dll differ diff --git a/obj/Debug/net9.0/strings_3.pdb b/obj/Debug/net9.0/strings_3.pdb index 0c5c070..692d0d0 100644 Binary files a/obj/Debug/net9.0/strings_3.pdb and b/obj/Debug/net9.0/strings_3.pdb differ