Opzione 3
This commit is contained in:
parent
cce7ba5469
commit
8016697863
40
Program.cs
40
Program.cs
@ -13,8 +13,8 @@ class Program {
|
|||||||
Console.WriteLine("Inserire un'opzione:");
|
Console.WriteLine("Inserire un'opzione:");
|
||||||
Console.WriteLine("1. Conta spazi pre maiuscola");
|
Console.WriteLine("1. Conta spazi pre maiuscola");
|
||||||
Console.WriteLine("2. Converti in binario");
|
Console.WriteLine("2. Converti in binario");
|
||||||
Console.WriteLine("3. Primo carattere maiuscolo");
|
Console.WriteLine("3. Stampa a gruppi di 3");
|
||||||
Console.WriteLine("4. Sostituisci sottostringa");
|
Console.WriteLine("4. Codifica");
|
||||||
Console.WriteLine("5. Parola palindroma pari");
|
Console.WriteLine("5. Parola palindroma pari");
|
||||||
Console.WriteLine("0. Esci");
|
Console.WriteLine("0. Esci");
|
||||||
Console.Write("Scelta: ");
|
Console.Write("Scelta: ");
|
||||||
@ -35,30 +35,11 @@ class Program {
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
stringa1 = Input();
|
GruppiDiTre(Input());
|
||||||
|
|
||||||
/* if (Controllo2(stringa1, LUNGHEZZA)) {
|
|
||||||
Console.WriteLine(PrimoCarattereMaiuscolo(stringa1));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Console.WriteLine($"Errore: la frase non può essere più lunga di {LUNGHEZZA} caratteri");
|
|
||||||
}*/
|
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
Console.WriteLine("È richiesta la frase in cui effettuare la ricerca");
|
|
||||||
stringa1 = Input();
|
|
||||||
Console.WriteLine();
|
|
||||||
Console.WriteLine("È richiesta la frase che verrà sostituita");
|
|
||||||
stringa2 = Input();
|
|
||||||
Console.WriteLine();
|
|
||||||
/*if (Controllo2(stringa2, stringa1.Length)) {
|
|
||||||
Console.WriteLine(TrovaESostituisci(stringa1, stringa2));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Console.WriteLine($"Errore: la frase da cercare non può essere più lunga della frase in cui cercare");
|
|
||||||
}*/
|
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
@ -66,11 +47,6 @@ class Program {
|
|||||||
//Console.WriteLine(CreaPalindromo(Input(), true));
|
//Console.WriteLine(CreaPalindromo(Input(), true));
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
case 6:
|
|
||||||
Console.Clear();
|
|
||||||
//Console.WriteLine(CreaPalindromo(Input(), false));
|
|
||||||
Pausa();
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
Console.WriteLine("Opzione non valida.");
|
Console.WriteLine("Opzione non valida.");
|
||||||
Pausa();
|
Pausa();
|
||||||
@ -116,4 +92,14 @@ class Program {
|
|||||||
Console.Write("Inserire un numero: ");
|
Console.Write("Inserire un numero: ");
|
||||||
return Convert.ToString(Convert.ToInt32(Console.ReadLine()), 2);
|
return Convert.ToString(Convert.ToInt32(Console.ReadLine()), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void GruppiDiTre(string p_stringa) {
|
||||||
|
for (int i = 0; i < p_stringa.Length; i++) {
|
||||||
|
if (i % 3 == 0 && i != 0) {
|
||||||
|
Console.Write('-');
|
||||||
|
}
|
||||||
|
Console.Write(p_stringa[i]);
|
||||||
|
}
|
||||||
|
Console.WriteLine();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("strings_4")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("strings_4")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cecacadf82f4550337db97f3140dafdfa966695d")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cce7ba546976b400f613cfa17cf408d3af20d0c1")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("strings_4")]
|
[assembly: System.Reflection.AssemblyProductAttribute("strings_4")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("strings_4")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("strings_4")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
5243215eb45f40b218b4e71f61c91a255525290d9fa357e38b27a9c22cb475d7
|
b0c34602d823055cddc7c771d50c3fe4da181b0e802d7ba1da76f4950a2766be
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user