DatabricksOA #10
Star Frame n×n
Estimated EasyJudge-ready
Topics (AI-labelled)Strings
Given a positive integer n, output n identical lines; each line contains n asterisks, with exactly one space between adjacent asterisks.
Standard input/output and this site's supplementary ranges follow this problem's description.
Input
One line containing an integer n, 1≤n≤100.
Output
Output exactly n lines; each line contains n asterisks, with one space between adjacent asterisks.
Example 1
Input:
2
Output:
* *
* *
Example 2
Input:
5
Output:
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
Example 3
Input:
8
Output:
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
Editorial
Loading solution…