当前位置:   article > 正文

明解C语言 入门 课后习题练习答案 第十二章_明解c语言入门篇答案第十二章

明解c语言入门篇答案第十二章

12-1

  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include<stdio.h>
  3. #define NAME_LEN 64
  4. struct student
  5. {
  6. char name[NAME_LEN];
  7. int height;
  8. float weight;
  9. long schols;
  10. };
  11. int main()
  12. {
  13. struct student takao = { "Takao",173,86.2 };
  14. printf("%p %p %p %p", &takao.name, &takao.height, &takao.weight, &takao.schols);
  15. return 0;
  16. }

12-2

  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include<stdio.h>
  3. #define NAME_LEN 64
  4. typedef struct student
  5. {
  6. char name[NAME_LEN];
  7. int height;
  8. float weight;
  9. long schols;
  10. }Student;
  11. void hiroko(Student* std)
  12. {
  13. if (std->height < 180)
  14. std->height = 180;
  15. if (std->weight > 80)
  16. std->weight = 80;
  17. }
  18. int main()
  19. {
  20. int height, schols;
  21. double weight;
  22. printf("身高:"); scanf("%d", &height);
  23. printf("体重:"); scanf("%lf", &weight);
  24. printf("奖学金:"); scanf("%d&#
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/编程领航者/article/detail/62794
推荐阅读
相关标签
  

闽ICP备14008679号