CPTTRN1 - Character Patterns (Act 1)
Using two characters: . (dot) and * (asterisk) print a chessboard-like pattern. The first character printed should be * (asterisk).
Input
You are given t < 100 - the number of test cases and for each of the test cases two positive integers: l - the number of lines and c - the number of columns in the pattern (l, c < 100).
Output
For each of the test cases output the requested pattern (please have a look at the example). Use one line break in between successive patterns.
Example
Input: 3 3 1 4 4 2 5 Output: * . * *.*. .*.* *.*. .*.* *.*.* .*.*.
hide comments
spsk_1313:
2018-08-26 09:00:24
Can any one give me the code in Python 3
|
|
thesyncoder:
2018-06-10 07:52:28
easy enough , just do three nested loops , one outer loop for your array or vector , and the inner ones j and k for simple matrix like loops, and print * if j+k %2 ==0 else print .Happy coding.
|
|
somyadeep99:
2018-06-01 11:54:46
i have got ac in one go, if you want solution send request mail at somyadeep99@gmail.com
|
|
vicc255:
2018-03-17 19:12:09
I thought the question was wrong but it's correct.See odd and even similarity between row no. and column no.
|
|
jairaj_sahgal:
2018-03-10 15:18:23
I love it
|
|
secret_santa1:
2017-12-20 15:57:16
Approach-1)Draw a chessboard and enter the given values i.e. fill the chessboard with "." and "*"(say 4*4 chessboard)
|
|
vinay11vishu:
2017-11-13 20:08:34
@vshantam
|
|
vshantam:
2017-11-12 10:40:24
@vinay11vishu
|
|
vinay11vishu:
2017-10-29 11:17:16
Can anybody explain me how the input should be given to this program ?? Last edit: 2017-10-29 12:35:27 |
|
imtiaz_mehedi:
2017-08-30 19:35:31
i have done it..it shows the right output but here it said it's wrong Last edit: 2017-08-30 19:35:57 |
Added by: | kuszi |
Date: | 2012-09-03 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |