星星(java)
package text;
import java.util.Scanner;
public class xingxing {
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
System.out.println("请输入行数:");
int m=sc.nextInt();
System.out.println("请输入列数:");
int n=sc.nextInt();
pringxing(n,m);//void类型的方法调用
}
public static void pringxing(int n,int m)
{
for(int i=1;i<=m;i++)
{
for(int j=1;j<=n;j++)
{
System.out.print('*');
}
System.out.println();
}
}
}