You should use srand only once in the entire program.
What happens here: time() returns current time. It is low res timer, so program could execute thousand of lines before its value changes. You are forcebilly resetting seed with the same value in loop forcing next generated value be the same.
As I said you do not give your program a chance to generate another number instead resetting it to same value.
I already said what you need to do to get rid of that behavior in the first sentense of my previous post.