帮忙解决error问题
#include<iostream>using namespace std;
class Average
{
private:
int a,b,c,y;
double i,j,k,z;
public:
void multiplication(int d,int e,int f)
{
a = d;
b = e;
c = f;
}
void multiplication(double l,double m,double n)
{
i = l;
j = m;
k = n;
}
void showdata()
{
cout<<"\nAverage of integer :"<<y<<endl;
cout<<"\nAverage of double :"<<z<<endl;
}
void calculate()
{
y = (a+b+c)/3;
z = (i+j+k)/3;
}
};
void main()
{
int a,b,c,y;
double i,j,k,z;
cout<<"Enter three integer number: "<<endl;
cin>>a>>b>>c;
cout<<"Enter three double number: "<<endl;
cin>>i>>j>>k;
Average avg;
avg.multiplication(a,b,c);
avg.multiplication(i,j,k);
avg.calculate();
avg.showdata();
}
看红字的error为什么会
aaa.cpp
C:\Users\CompaQ\Desktop\w\aaa.cpp(38) : warning C4101: 'y' : unreferenced local variable
C:\Users\CompaQ\Desktop\w\aaa.cpp(39) : warning C4101: 'z' : unreferenced local variable