Code and result look correct, see no problem. If something else comes out, something is wrong with the input file "kartosan.dat".
Here is code that seems unnecessary:
if (key value)
{ ...}
else if (key >= leaf->value)
{ ...}
You also forgot:
input.close();
There should also be other methods, e.g.:
void btree::inorder_print(ofstream &ofile)
I would avoid the name output.
Something is wrong with the class definition.
The member variables should never be external be changeable. So something like this:
class btree {
public:
...
private:
node *root;
void insert(int key, node *leaf);
node *search(int key, node *leaf);
}