你的任務是將每個部門的人事資料整理成一份,並以特定的格式輸出。每份部門資料以last name作排序,請你將這些資料組合成一份,並以last name排序輸出。
Input
輸入的第一列有一個整數N(2 <= N <= 12)表示部門的總數,接下來有N組部門的資料,每組部門資料的第一列為其部門名稱,接下來每一列為其部門內部人員的資料,其格式為:Title, First Name, Last Name, Street Address, Home Phone, Work Phone, Campus Mailbox,為七個以逗號隔開的欄位。每組部門資料以一列空行隔開。
Output
每筆輸出資料格式為:--------------------
<Title> <FirstName> <LastName>
<HomeAddress>
Department: <Department>
Home Phone: <HomePhone>
Work Phone: <WorkPhone>
Campus Box: <CampusBox>
"<"與">"符號只是用來顯示各欄位,並不需要輸出。請注意格式中的空白字元。
Sample Input
2 English Department Dr.,Tom,Davis,Anystreet USA,555-2832,555-2423,823 Mrs.,Jessica,Lembeck,Center Street,555-2543,555-8584,928 Computer Science Mr.,John,Euler,East Pleasure,555-1432,555-2343,126
Sample Output
---------------------------------------- Dr. Tom Davis Anystreet USA Department: English Department Home Phone: 555-2832 Work Phone: 555-2423 Campus Box: 823 ---------------------------------------- Mr. John Euler East Pleasure Department: Computer Science Home Phone: 555-1432 Work Phone: 555-2343 Campus Box: 126 ---------------------------------------- Mrs. Jessica Lembeck Center Street Department: English Department Home Phone: 555-2543 Work Phone: 555-8584 Campus Box: 928
原文出處
沒有留言:
張貼留言