1. //
    2. // main.c
    3. // test_a8
    4. //
    5. // Created by dezhu on 2021/12/28.
    6. // Copyright © 2021年 dezhu. All rights reserved.
    7. //
    8. #include <stdio.h>
    9. int main(int argc, const char * argv[]) {
    10. // insert code here...
    11. struct date{
    12. int year;
    13. int month;
    14. int day;
    15. };
    16. struct date today;
    17. today.year = 2020;
    18. today.month = 04;
    19. today.day = 20;
    20. printf("%i.%i.%i",today.year,today.month,today.day);
    21. system("pause");
    22. printf("Hello, World!\n");
    23. return 0;
    24. }
    1. //
    2. // main.c
    3. // test_a9
    4. //
    5. // Created by dezhu on 2021/12/28.
    6. // Copyright © 2021年 dezhu. All rights reserved.
    7. //
    8. #include <stdio.h>
    9. int main(int argc, const char * argv[]) {
    10. // insert code here...
    11. struct date{
    12. int year;
    13. int month;
    14. int day;
    15. };
    16. struct date days[3]={
    17. {2020,04,20},
    18. {2020,05,20},
    19. {2020,06,20}
    20. };
    21. printf("%i.%i.%i",days[2]);
    22. system("pause");
    23. printf("Hello, World!\n");
    24. return 0;
    25. }
    1. //
    2. // main.c
    3. // test_a10
    4. //
    5. // Created by dezhu on 2021/12/28.
    6. // Copyright © 2021年 dezhu. All rights reserved.
    7. //
    8. #include <stdio.h>
    9. int main(int argc, const char * argv[]) {
    10. struct date{
    11. int year;
    12. int month;
    13. int day;
    14. };
    15. struct days{
    16. struct date yesterday;
    17. struct date today;
    18. struct date tomorrow;
    19. };
    20. struct days one[2]={
    21. {{2020,04,19}},
    22. {{2020,04,20}}
    23. };
    24. printf("%i.%i.%i",one[1]);
    25. return 0;
    26. }
    1. //
    2. // main.c
    3. // test_a11
    4. //
    5. // Created by dezhu on 2021/12/28.
    6. // Copyright © 2021年 dezhu. All rights reserved.
    7. //
    8. #include <stdio.h>
    9. int main(int argc, const char * argv[]) {
    10. // insert code here...
    11. union date{
    12. int year;
    13. int month;
    14. int day;
    15. }today;
    16. //struct date today;
    17. today.year = 2020;
    18. today.month = 04;
    19. today.day = 20;
    20. printf("%i.%i.%i",today.year,today.month,today.day);
    21. system("pause");
    22. printf("Hello, World!\n");
    23. return 0;
    24. }