销售部新进了一台快速打印机,使用频率很高。为了能够对打印情况进行统计,规定每个人在打印后需要登记时间和用纸张数。
注:本题只需要提交修改和完善部分的代码,请按照C++方式提交。
#include <iostream>
using namespace std;
class FastPrinter
{
public:
FastPrinter() {}
FastPrinter(int year,int month,int day,int num);
~FastPrinter() {}
void PrintJob() {}
static unsigned int getcounts()
{
return counts;
}
static unsigned int gettotals()
{
return totals;
}
private:
static unsigned int counts;
static unsigned int totals;
int year,month,day;
};
/* 修改和完善该部分代码
unsigned int FastPrinter::counts = 0;
FastPrinter::FastPrinter(int year,int month,int day,int num):year(year),month(month),day(day)
{
totals++;
}
*/
int main()
{
FastPrinter *fp;
int year,month,day,num;
int n,m;
cin>>n;
while(n--)
{
cin>>m;
while(m--)
{
cin>>year>>month>>day>>num;
fp=new FastPrinter(year,month,day,num);
fp->PrintJob();
delete fp;
}
}
cout<<"打印次数:"<<FastPrinter::getcounts()<<",张数:"<<FastPrinter::gettotals()<<endl;
return 0;
}