为什么最后乱码
#include<iostream>using namespace std;
template<typename T>
class arry
{public:
arry(int s)
{if(s>1)
size=s;
else
size=1;
b=new T[size];}
~arry()
{delete [] b;}
T& entry(int a)
{return b[a];}
void set()
{int i;
for (i=0;i<size;i++)
{cout<<"请输入"<<endl;
cin>>b[i];}
}
void sum()
{int j;
for (j=0;j<size;j++)
c+=b[j];
cout<<"和"<<c<<endl;}
double average()
{return c/size;}
int c;
int size;
T *b;
};
int main()
{int a;
cout<<"输入要的个数"<<endl;
cin>>a;
arry<int> intarry(a);
intarry.set();
intarry.sum();
cout<<intarry.average()<<endl;
return 0;}