You can use the stdio.h instead of iostream. With stdio.h you can print long double in the following way:
long double d = 100.0;
printf("%Lf",d); -> This wil print something like 100.00000000
To cut the 0's in the end you can modify the %lf in the following way
printf("%.3Lf",d); -> The number after the dot is how many digits you want to print after the hole part.
If someone knows hoe to do it with iostram I would also be intrested to understand... Now when I have doubles in the problem I use stdio, otherwise iostream...
[Edit] "Lf" instead of "lf" after misof noticed my mistake. I'm sorry.
Last edited by andresw1 on Sun Apr 02, 2006 4:11 pm, edited 1 time in total.