新建文件
This commit is contained in:
parent
2b1eee3be8
commit
587ad6a38a
|
@ -9,11 +9,10 @@ struct student {
|
|||
} studentList[3] = {{"SB1", 'F', 239}, {"SB2", 'F', 232}, {"SB3", 'M', 832}};
|
||||
int main() {
|
||||
student *ptr;
|
||||
cout << setw(9) << "Name "
|
||||
<< "Sex "
|
||||
cout << setw(10) << "Name " << setw(4) << "Sex "
|
||||
<< "Score " << endl;
|
||||
for (ptr = studentList; ptr < studentList + 3; ptr++) {
|
||||
cout << setw(9) << ptr->name << " " << setw(1) << ptr->sex << " "
|
||||
cout << setw(9) << ptr->name << " " << setw(3) << ptr->sex << " "
|
||||
<< setw(3) << ptr->score << endl;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue