Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve (num) {
- function NxNMatrix() {
- let print = '';
- for (let i = 0; i < num; i++) {
- for (let j = 0; j < num; j++) {
- print += num + ' ';
- }
- print += '\n';
- }
- return print;
- }
- console.log(NxNMatrix());
- }
- Или :
- function solve (num) {
- for (let i = 0; i < num; i++) {
- console.log(`${num} `.repeat(num));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement