Question: [C++] Grass field Write a program input information of field also a command for cow to eat grass, and for gardener to grow grass.Then show

 [C++] Grass field Write a program input information of field also

[C++] Grass field Write a program input information of field also a command for cow to eat grass, and for gardener to grow grass.Then show the output of a field after all command. Input First line specify integer N and M (3N 100, 1M1,000) represent size of field and number of another N lines, each line have N character show map of field. another M lines, each line contain 1 character for specify command and interger to specify row or column (1 1 is top-left, N N is bottom-right) .' represent blank space nothing there x' represent grass # represent rock Lk command cow to eat grass on row k, by starting from leftmost and walk to right Rk command cow to eat grass on row k, by starting from rightmost and walk to left Uk command cow to eat grass on column k, by starting from uppermost and walk down D k command cow to eat grass on row k, by starting from bottom and walk up Ak command gardener to grow grass on row k, Exept block that is rock Bk command gardener to grow grass on column k, Exept block that is rock NOTE k is integer from 1 to N Output Have N lines, each line have N character show map of a field after all commands Example1 Example2 Input 5 3 Output Output nput 5 4 X#XXX X#XXX L3 U 4 L5 D 4 U 4 B3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!