#include
using namespace std;
class Cargo
{
private:
double weight;
double price;
public:
int no;//序号
Cargo *next;
static double totalweight;
static double totalprice;
Cargo(double weight, double price, int no){
this->no=no;
this->weight=weight;
this->price=price;
totalweight+=this->weight;
totalprice+=this->price;
}
~Cargo(){
totalweight-=weight;
totalprice-=price;
}
};
class CargoHouse
{
private:
double w;
double p;
int no;//序号
Cargo *data,*head;
public:
CargoHouse(){
data=head;
head=NULL;
}
void in(){
cin>>w;cin>>p;cin>>no;
Cargo *k=new Cargo(w,p,no);
k->next=data;
data=k;
}
void out(int n){
Cargo *q=data;
Cargo *h=head->next;
while(h){
if(h->no==n)
{
q->next=h->next;
delete h;
}
else
{
q=h;
h=h->next;
}
}
cout<<"没有";
}
};
int main()
{
CargoHouse thing1;
thing1.in();
return 0;
}