Will this code work? (simple)

No.

Most of the statements in your loop() are nonsense.

Z is one dimension array so it cannot hold 2 strings (you would need to do char Z[][20] ...)

...