/*
1 定义一个功能,用于打印矩形
2 定义一个打印99乘法表功能的函数
*/
class FunctionTest
{
public static void main(String[] args)
{
//draw(4,5);
//printhr();
//draw(8,7);
//printhr();
print99();
}
public static void draw(int hang,int lie)
{
for(int x=0;x<hang;x++)
{
for(int y=0;y<lie;y++)
{
System.out.print("*");
}
System.out.println();
}
}
public static void printhr()
{
System.out.println("-------------------------");
}
public static void print99()
{
for(int x =1;x<=9;x++)
{
for(int y =1;y<=x;y++)
{
System.out.print(y+"*"+x+"="+x*y+"\t");
}
System.out.println();
}
}
}打印矩形跟99乘法表
最新推荐文章于 2024-02-20 11:17:29 发布
1470

被折叠的 条评论
为什么被折叠?



