110,555
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication35
{
class Program
{
public struct Book
{
}
static void Main(string[] args)
{
Program gs = new Program();
Console.WriteLine("1,三角形 2,长方形,3菱");
string str=Console.ReadLine();
int i = 0;
int.TryParse(str,out i);
Console.WriteLine("请输入行数");
string str1 = Console.ReadLine();
int j = 0;
int.TryParse(str1,out j);
switch (i)
{
case 1: gs.Print1(j);
break;
}
}
private void Print1(int i)
{
for (int j = 1; j <= i; j++)
{
for (int k = 0; k <j; k++)
{
Console.Write("*");
}
Console.WriteLine();
}
}
}
}