《21天学通C#》嵌套循环,输出上三角形X。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _1_嵌套循环输出X_
{
class Program
{
static void Main(string[] args)
{
int x, y;
for (x=0; x < 10; x++,System.Console.Write(" "))
{
for(y=0;y<x;y++)
{
System.Console.Write("X");
}
}
Console.WriteLine("请按任意键退出程序!");
Console.ReadKey();
}
}
}

原文地址:https://www.cnblogs.com/nnty/p/9908927.html