// Why some iostream need put .h and other no need put .h ????
//It prints a line of text
#include <iostream>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
using std::ios;
#include <fstream>
using std::ofstream;
#include <math.h>
#include <iomanip>
using namespace std;
Did you really need to post your entire program to ask that question? =P
Anyway, you #include whatever filename the file has. The reason it's <iostream> and not <iostream.h> is because the file name is iostream. There's no .h on it. For whatever reason, the C++ standard lib headers have no extention.
As for <math.h>... that's a standard C (read: not C++) header. C headers had the .h.
C++ "adopted" some of the old C headers, but renamed them. They got rid of the .h at the end and prefixed it with a c. So instead of #include <math.h>, you would include <cmath>
<math.h> still works though because most /all C++ compilers are also C compilers and therefore come with both the C and C++ standard libraries.
When C++ was first created, all of the files in the standard runtime library ended in .h. Life was consistent, and it was good. The original version of cout and cin lived in iostream.h. When the language was standardized by the ANSI committee, they decided to move all of the functions in the runtime library into the std namespace (which is generally a good idea). However, this presented a problem: if they moved all the functions into the std namespace, none of the old programs would work any more!
To try to get around this issue and provide backwards compatibility for older programs, a new set of header files was introduced that use the same names but lack the .h extension. These new header files have all their functionality inside the std namespace. This way, older programs that include #include <iosteam.h> do not need to be rewritten, and newer programs can #include <iostream>.
Make sure when you include a header file from the standard library that you use the non .h version if it exists. Otherwise you will be using a deprecated version of the header that is no longer supported.