monoteen

1030_3-12_자료구조

Oct 29th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. struct employee {
  5.     char name[10];
  6.     int year;
  7.     int pay;
  8. };
  9.  
  10. int main(void)
  11. {
  12.     int i;
  13.     struct employee Lee[4] =
  14.     {
  15.         { "이민수", 2002, 3200 },
  16.         { "이상건", 2002, 3000 },
  17.         { "이진호", 2004, 2500 },
  18.         { "이한영", 2003, 2900 }
  19.     };
  20.  
  21.     for (i = 0; i < 4; i++) {
  22.         printf("\n 이름 : %s", Lee[i].name);
  23.         printf("\n 입사 : %d", Lee[i].year);
  24.         printf("\n 연봉 : %d \n\n", Lee[i].pay);
  25.     }
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment