应该是申请动态结构数组,代码如下:
#include <iostream>
struct tt
{
char name [20];
double pace;
};
int main()
{
using namespace std;
int i=0,count=0;
cout<<"请输入捐献者数目:count==";
cin>>count;
tt* jk=new tt[count];
while(i++<count)
{
cout<<"请输入姓名:";
cin>>jk[i].name;
cout<<"请输入捐款金额:";
cin>>jk[i].pace;
}
cout<<"Grand Patrons:\n";
for(i=0;i<count;i++)
if(jk[i].pace>10000)
cout<<jk[i].name<<endl;
system("pause");
return 0;
}