006-002-001

Rectangle Stars Pattern

Easy

Problem Description

Create a program that prints a rectangle of stars using nested for loops. Given rows and columns, print a grid of '*' characters with the specified dimensions.

Test Cases

※ Output examples follow programming industry standards

Input:
3, cols = 5
Expected Output:
*****
*****
*****
Input:
2, cols = 3
Expected Output:
*****
*****
*****
Input:
4, cols = 4
Expected Output:
*****
*****
*****
Input:
1, cols = 6
Expected Output:
*****
*****
*****
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here

sc.close();
}
}
0 B / 5 MB

You have 9 free executions remaining