+ 2

[ algorithm CHALLENGE ] : big text cross

Implement a simple algorithm to write a variable sized cross to the screen. Size is entered by the user and must be an odd number. It would be nice if your program gives error messages when the input is not a number or if the number is even. The odd size specifies the width and height of your cross, so it basically is built up of characters X to make a line and spaces as fill up. The examples below are a bit weird as this page doesn't have a fixed width font. Examples: - size 3: X X X X X - size 9: X X X X X X X X X X X X X X X X X - size 4: Error: it seems that '4' is not an odd number - size A: Error: it seems that 'A' is not an integer

9th Feb 2018, 9:59 AM
Freddy
4 ответов
+ 6
https://code.sololearn.com/cYXb3YQFdzZl/?ref=app
9th Feb 2018, 10:39 AM
Louis
Louis - avatar