Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include<string.h>
- struct student //定義student的資料結構
- {
- int student_id;
- char name[50];
- int score;
- };
- struct student student1,student2,student3; //定義3個資料結構變數
- int main(void)
- {
- student1.student_id=10007142;
- strcpy(student1.name,"臨例會");
- student1.score=94;
- printf("學號 姓名 分數\t\n");
- printf("%d %s %d\n",student1.student_id,student1.name,student1.score);
- student2.student_id=10007143;
- strcpy(student2.name,"剪宏語");
- student2.score=95;
- printf("%d %s %d\n",student2.student_id,student2.name,student2.score);
- student3.student_id=10007147;
- strcpy(student3.name,"成宴如");
- student3.score=96;
- printf("%d %s %d\n",student3.student_id,student3.name,student3.score);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement