Advertisement
archen2019

andycourse

Jul 20th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. struct course {
  2. int section;
  3. char field[20];
  4. char grade;
  5. };
  6.  
  7. course a[30];
  8.  
  9. void populate() {
  10. for(int i = 0; i < 30; i++) {
  11. cin >> a[i].section;
  12. cin >> a[i].field;
  13. cin >> a[i].grade;
  14. }
  15. }
  16.  
  17. void print() {
  18. for(int i = 0; i < 30; i++) {
  19. cout << a[i].section << " " << a[i].field << " " << a[i].grade << endl;
  20. }
  21. }
  22.  
  23. int main() {
  24.  
  25. populate();
  26. print();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement