Console.Write("请输入数字:"); int n = int.Parse(Console.ReadLine()); for (int i = 1; i <= n; i++) { for (int t = 1; t <i ;t++ ) { Console.Write("。"); } for (int a = n-i+1; a >=1;a--) { Console.Write("◎"); } Console.Write("\n"); } Console.ReadLine();
打印菱形
Console.Write("请输入数字:"); int n = int.Parse(Console.ReadLine()); for (int i = 1; i <= n; i++) { for (int t = 1; t <=n-i ;t++ ) { Console.Write("。"); } for (int a = 1; a <=2*i-1;a++) { Console.Write("★"); } Console.Write("\n"); } for (int m = 1; m < n; m++) { for (int p = 1; p<= m; p++) { Console.Write("。"); } for (int k= 1; k<= 2 * (n-m) - 1; k++) { Console.Write("★"); } Console.Write("\n"); } Console.ReadLine();
原文:http://www.cnblogs.com/liuyudong0825/p/4700632.html