using System;
using System.Collections.Generic;
using System.Text;
namespace test1
{
class Program
{
static void Main(string[] args)
{
int a = 9, k = 1,temp=0; //a为循环层数 k为打印数字 temp为临时标记k为减还是加
for (int i = 1; i <= a; i++)
{
for (int j = 1; j < (a * 2); j++)
{
if (j <= (a - i) )
Console.Write(" ");
else
{
if (k >=1)
{
if (j >= a)
{
temp = 1;
}
else temp = 0;
if (temp == 0)
{
Console.Write(k);
k++;
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载