CodePudding user response:
The title and the back of the subject to understand this problem,,,,The same line, the method of soil is polling bai, seat number + 2, 2 (regardless of the column) has selected give up, the next point to continue (can be optimized to find the next point method),
Combined with the processing of boundary and column, a bit tedious, but are not difficult,
CodePudding user response:
To apply for a two dimensional array, each element and seats are one-to-one correspondence, for there is no seat, marked negative, was not chosen for the seat, marked 0, to choose a seat, mark 1, according to choice of seats, traverse the array, depending on the array elements, the corresponding icon is displayed in the corresponding seatsCodePudding user response:
Define a bitmap, add tags, 0/1, 0 say not choose, 1 choice, that sounds like the memory that judgment used and unused,CodePudding user response:
With a regular expression matchCodePudding user response:
Can consider to do ~ have chosen to do the marking, already marked cannot choose ~