当前位置:首页 > C++PrimerPlus第六版课后题第七章
}
voidfill(money * pa, int n) {
for(inti= 0; i< n; i++) {
cout<<\<
voidshow(const money * pa, int n) {
double total = 0.0; cout<<\; for(inti = 0; i< n; i++) {
cout< cout<<\<< total < 9. #include usingnamespacestd; constint SLEN = 30; struct student { charfullname[SLEN]; char hoppy[SLEN]; intooplevel; }; intgetinfo(student pa[], int n); void display1(student st); void display2(const student * ps); void display3(const student pa[], int n); intmain() { cout<<\; 13 intclass_size; cin>>class_size; while(cin.get() != '\\n') continue; student * ptr_stu = new student[class_size]; int entered = getinfo(ptr_stu, class_size ); for(inti = 0; i< entered; i++) { display1(ptr_stu[i]); display2(&ptr_stu[i]); } display3(ptr_stu, entered); delete [] ptr_stu; cout<<\< intgetinfo(student pa[], int n) { inti = 0; for( i = 0; i< n; i++) { cout<<\<< i+1 ; char choose; if(cin>> choose && ( 'Y'== choose || 'y' ==choose)) { cout<<\ ; cin.sync(); cin.getline(pa[i].fullname, SLEN); cout<<\ ; cin.getline(pa[i].hoppy, SLEN); cout<<\; cin>> pa[i].ooplevel; } else break; } returni; } void display1(student st) { cout<<\< 14 cout<<\< cout<<\< void display2(const student * ps) { cout<<\<< (* ps).fullname< cout<<\<< (* ps).ooplevel< void display3(const student pa[], int n) { for (inti = 0; i cout<<\< cout<<\<< pa[i].ooplevel< 15
共分享92篇相关文档