Download - C++ 语言程序设计

Transcript
  • [email protected]

  • C++.. . 2004.

  • C++ Primer Plus.Stephen Prata..2002.C++ ()....2002.C++Primer_3rd...

  • 56(3-11)4-1212785613

  • 1 C++8 9 10 11 12 13

  • 1 C++ 1.1 CC++ 1.2 C++ 1.3 C++ 1.4 C++ 1.5 C++

  • 1.1 CC++1954FORTRAN1964BASIC1972CD.M.Ritchie2080 C++AT&T Bell()Bjarne StroustrupC

  • 1.1 CC++C++1.0 1988C++2.0 1989C++3.0 1991C++4.0 ANSI C++ 1997

  • C++C(1) C(2)

  • ;double sqrt(double arg){ // code for calculating a square root}void f(){ double root2 = sqrt(2); //}

  • 1.2 C++1.1 This is a C++ program. #include //iostreamusing namespace std; //stdint main( ){cout
  • 1.2 ab

    #include //using namespace std; //stdint main( ) //{ // int a,b,sum; // cin>>a>>b; // sum=a+b; // cout

  • 1.3 xy#include //using namespace std;int max(int x,int y) //max{ int z; if(x>y) z=x; //ifx>yxz else z=y; //yz return z; //zmax} //maxint main( ) //{ int a,b,m; // cin>>a>>b; // m= max(a,b); cout
  • 1.4 C++#include // using namespace std;class Student // Student{private: // int num; // numint score; // scorepublic: // void setdata( ) // setdata{cin>>num; // numcin>>score; // score}

  • void display( ) // display {cout
  • 1001 98.5 (1)1002 76.5 (2)

    num=1001 (1)score=98.5 (1)num=1002 (2)score=76.5 (2)

  • 1.3 C++C++ () :

  • 1.3 C++: C++main(class)C++C++

  • 1.11.4 C++

  • 1.5 C++Visual C++ 6.0 Visual C++.NETGCC