#include

#include

using namespace std;

class Books

{

  char title[10],author[10];

  int code,price;

 public:

  static int sum,allp;

  Books(int c,int p ,char t[10],char a[10])

  {

   code=c;

   price=p;

   strcpy(title,t);

   strcpy(author,a);

   sum++;

   allp=allp+p;

   cout<<"編號:"<

    <

  }

};

int Books::allp=0;

int Books::sum=0;

void main()

{

Books b1(1,560,"Shift","Me");

Books b2(2,300,"Ctrl","You");

Books b3(3,9999,"Space","He");

 

cout<<"課本總數:"<

}


創作者介紹
創作者 Miti's Blog 的頭像
mitia

Miti's Blog

mitia 發表在 痞客邦 留言(1) 人氣( 60 )