Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct course {
- int section;
- char field[20];
- char grade;
- };
- course a[30];
- void populate() {
- for(int i = 0; i < 30; i++) {
- cin >> a[i].section;
- cin >> a[i].field;
- cin >> a[i].grade;
- }
- }
- void print() {
- for(int i = 0; i < 30; i++) {
- cout << a[i].section << " " << a[i].field << " " << a[i].grade << endl;
- }
- }
- int main() {
- populate();
- print();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement