_JUNZHANG
2017-09-18 16:18
C#零基础课程的4-9编程题怎么做?
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
if(x==y)
break;
}
Console.WriteLine();//换行
}
}
}
}
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
Console.WriteLine();
}
C#开发轻松入门
254118 学习 · 1459 问题
相似问题