新建文件

This commit is contained in:
Hmtsai 2023-11-12 16:00:33 +08:00
parent 2b1eee3be8
commit 587ad6a38a
1 changed files with 2 additions and 3 deletions

View File

@ -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;