Impossible for us to know with that little bit of code....and we don't even know what exactly is wrong. Please post more code. Only thing I can think of is you are accessing wrong parts of the rank array or the values they are not equal to are wrong?
[edit]
(ispils post wasn't up when I responded origonally
@Ispil technically he wouldn't need the else because he has it return 1 at the end. So if it is not any of those things then it returns 1 automatically.
After looking at the code again though
maybe it should be if( rank[0] != 13 && rank[1] != 12 && rank[2] != 11 && rank[3] != 10 && rank[4] != 1 ) return( 0 );