Opzione 4
This commit is contained in:
parent
776cdec796
commit
ddb26dc126
17
Program.cs
17
Program.cs
@ -5,6 +5,7 @@ class Program {
|
||||
Console.Clear();
|
||||
|
||||
char unit = '*'; //unità usata per stampare le figure
|
||||
char unit2 = '+'; //unità usata per stampare metà dell'ultima figura
|
||||
|
||||
int scelta = -1;
|
||||
do {
|
||||
@ -12,7 +13,7 @@ class Program {
|
||||
Console.WriteLine("1. Stampa quadrato pieno");
|
||||
Console.WriteLine("2. Stampa quadrato vuoto");
|
||||
Console.WriteLine("3. Stampa triangolo");
|
||||
Console.WriteLine("4. Stampa ");
|
||||
Console.WriteLine("4. Stampa quadrato diagonale");
|
||||
Console.WriteLine("0. Esci");
|
||||
Console.Write("Scelta: ");
|
||||
|
||||
@ -35,6 +36,7 @@ class Program {
|
||||
Pausa();
|
||||
break;
|
||||
case 4:
|
||||
QuadratoDiagonale(Dimensione(), unit, unit2);
|
||||
Pausa();
|
||||
break;
|
||||
default:
|
||||
@ -120,4 +122,17 @@ class Program {
|
||||
Console.WriteLine("");
|
||||
}
|
||||
}
|
||||
|
||||
static void QuadratoDiagonale(uint p_dimensione, char p_unit, char p_unit2) {
|
||||
int j;
|
||||
for (int i = 1; i <= p_dimensione; i++) {
|
||||
for (j = 1; j <= i; j++) {
|
||||
Console.Write(p_unit);
|
||||
}
|
||||
for (int k = (int)p_dimensione - --j; k > 0; k--) {
|
||||
Console.Write(p_unit2);
|
||||
}
|
||||
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("vacanzeEstive_sezione1")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2f640465ecbd3037171ec0a9bd282a674c8a7dd1")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+776cdec796a5f482358633a717e41320b0bcbd80")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("vacanzeEstive_sezione1")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("vacanzeEstive_sezione1")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@ -1 +1 @@
|
||||
9cba433da9da8ea59d624971f030b8e8bdd284797161d60c7f99bfa12d4021a0
|
||||
92a5338a93bd529071a40558b1cc17cf0056e19c3ef326c4b1b4c1822677378d
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user