firstly, get used to putting your code between [ code ] and [ /code ] tags (without the spaces)...
secondly.. here's a hint
the program is not complete.. but it's nearly there.. i didn't want to finish it for you because you wouldn't learn anything from it!
int x, y;
cout << "Please give me the two legs of the triangle." << endl;
cout << "First leg: " << endl;
x = atoi(buffer);
} while(x == 0);
cout<<endl<<"Second leg: "<<endl;
y = atoi(buffer);
} while(y == 0);
cout << endl << "one moment please..." << endl;
cout << "the hypotenuse length is " << sqrt(x * x + y * y) << endl << endl;