#include<iostream>
#include<string>
using namespace std;
class student{
public:
student(int id1,string name1,double score1);
void show();
static void show_count_sum_ave();
private:
int id;
string name;
double score;
static int count;
static double sum;
static double ave;
};
student::student(int id1,string name1,double score1)
{id=id1;
name=name1;
score=score1;
++count;
sum=sum+score;
ave=sum/count;
}
void student::show()
{cout<<"姓名:"<<name<<endl;
cout<<"学号:"<<id<<endl;
cout<<"成绩:"<<score<<endl;
}
void student::show_count_sum_ave()
{cout<<"学生人数:"<<count<<endl;
cout<<"学生总成绩:"<<sum<<endl;
cout<<"学生平均成绩:"<<ave<<endl;
}
int student::count=0;
double student::sum=0.0;
double student::ave=0.0;
int main()
{student stu1(01,"zhangsan",90);
stu1.show();
student::show_count_sum_ave();
student stu2(02,"lisi",80);
stu2.show();
student::show_count_sum_ave();
student stu3(03,"wangwu",70);
stu3.show();
student::show_count_sum_ave();
return 0;
}