I need to make a matrix[n][n], where n is inputed by the user and the matrix would store the characters 's', 'z' or 'o'. I need to make a random statement, where it would only generate one out of these three for each space in the matrix..
Example: n=3
s z o o s z s s s
...now i will use this matrix to count how many times each of the characters has appeared, but this is not the reason im writing...I just can't figure out how to generate these characters...i mean..i know numbers...and characters from ascii from 65 to 90 and so on,...but only 3 letters to choose from? help me please.. i dont need the whole code just the statement to generate this random letters.
Aucun commentaire:
Enregistrer un commentaire