三角形

Console.Write("请输入直角三角形的行数:");inta = Convert.ToInt32(Console .ReadLine ());for(intb =0; b < a +1; b++) {for(intc =1; c < b *2; c++) { Console.Write("*"); } Console.WriteLine(""); } Console.ReadKey();

Console.Write("请输入直角三角形的行数:");inta = Convert.ToInt32(Console.ReadLine());for(intb =0; b < a +1; b++) {for(intc =0; c < a-b; c++) { Console.Write("*"); } Console.WriteLine(""); } Console.ReadKey();

Console.Write("请输入等腰三角形的行数:");inta = Convert.ToInt32(Console .ReadLine ());for(intb =0; b < a; b++) {for(intc =0; c < a - b -1; c++) { Console.Write(" "); }for(intd =0; d <2* b +1; d++) { Console.Write ("*"); } Console.WriteLine("\n"); } Console .ReadKey ();

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容