1 Wire DS18B20

There are something seriously wrong with your code (some of which are quite obvious).

For example, the first sensor returns 0xf801 -> that should have been translated into a negative temperature but you got 1000+c.

Read the datasheet and understand what 9-bit or 10-bit resolution means, and what 2's complement means.