Can you copy the program's output from the command prompt window and paste it here so we can see what you are talking about?
Also add some comments to the print out describing the problem: <<<<< Here it should ...
The loop has two variables that are used to control its looping: z and rts
That is confusing. Can you change the logic so that only 1 variable is used?
Please edit your post and wrap your code with code tags:
[code]
**YOUR CODE GOES HERE**
[/code]
to get highlighting and preserve formatting.
it skip automaticly String
There is a problem with using nextInt followed by nextLine. nextInt leaves the line-end character in the Scanner's buffer. nextLine will return that line-end character as an empty line.
The solution is to call nextLine after calling nextInt to clear the line-end character.