现在的位置: 首页 > 综合 > 正文

c/c++ helloworld

2011年06月29日 ⁄ 综合 ⁄ 共 546字 ⁄ 字号 评论关闭

开始:

c:

#include    <errno.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int
main ( int argc, char *argv[] )
{
printf ("\nProgram %s\n\n", argv[0] );

return EXIT_SUCCESS;
} /* ---------- end of function main ---------- */

c++:

#include        <cstdlib>                                                    
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>

using namespace std;


int
main ( int argc, char *argv[] )
{
cout << "\nProgram " << argv[0] << endl << endl;

return EXIT_SUCCESS;
} // ---------- end of function main ----------

 

visual studio 

#include <iostream>
using namespace std;

int main()
{
cout<<"hello world!"<endl;
return 0;
}

 

抱歉!评论已关闭.