首页 > 其他 > 详细

编程题:对结构体变量中成员的引用展示。

时间:2014-05-20 18:40:36      阅读:496      评论:0      收藏:0      [点我收藏+]

编程题:对结构体变量中成员的引用展示。

#include<stdio.h>

void main()

{ struct person

{ char name[20];

  char sex;

    struct date

{int year;

  int month;

  int day;

}birthday;

float height;

}per;

printf("Enter the name:");

gets(per.name);per.sex=‘M‘;

per.birthday.year=2013;

per.birthday.year++;

per.birthday.month=12;

per.birthday.day=15;

per.height=(175+176)/2;

printf("%s%3c%4d/%2d/%d%7.1f\n",per.name,per.sex,

   per.birthday.month,per.birthday.day,

   per.birthday.year,per.height);

}

bubuko.com,布布扣

 


本文出自 “努力奋斗,互相提高” 博客,请务必保留此出处http://c10086.blog.51cto.com/6433044/1413771

编程题:对结构体变量中成员的引用展示。,布布扣,bubuko.com

编程题:对结构体变量中成员的引用展示。

原文:http://c10086.blog.51cto.com/6433044/1413771

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!