循环嵌套(基础练习)-
需求:请输出一个4行5列的星星(*)图案。
结果:
*****
*****
*****
*****
public class XunHuanQianTao { public static void main(String[] args) { //外层控制行数---内层控制列数 for(int x=0;x<4;x++){ for(int y=0;y<5;y++){ System.out.print("*"); } System.out.println(); } } }