Squares (3) P39359


Statement
 

pdf   zip

thehtml

Write a program that prints squares n × n. To fill all the squares, start using 0, 1, …, 9, 0, etc.

Input

Input consists of several natural numbers between 1 and 9.

Output

For every n, print a square of size n × n. Start filling the squares with 0, 1, …, 9, 0, etc. Separate two squares with an empty line.

Public test cases
  • Input

    3
    6
    1
    

    Output

    012
    345
    678
    
    901234
    567890
    123456
    789012
    345678
    901234
    
    5
    
  • Input

    
            
                                

    Output

    
            
                                
  • Input

    5
    

    Output

    01234
    56789
    01234
    56789
    01234
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    C C++ Java Python