练习39

点击蓝字
关注我们
DRAGON BOAT FESTIVAL
练习39
01 要求:
建立同学通讯录
例如:
输入姓名:张三,电话:100等
输出通讯录信息
02 程序示例如下:
// 建立同学通讯录struct mem{char name[20];char phone[10];};int main(){struct mem man[NUM];int i;for (i = 0; i<NUM; i++){printf("input name:\n");gets(man[i].name);printf("input phone:\n");gets(man[i].phone);}printf("name\t\t\tphone\n\n");for (i = 0; i<NUM; i++)printf("%s\t\t\t%s\n", man[i].name, man[i].phone);return 0;}
03:输出:
input name:
张三
input phone:
100
input name:
李四
input phone:
101
input name:
赵五
input phone:
102
name phone
张三 100
李四 101
赵五 102


球分享

球点赞

球在看
评论
