fork download
  1. #include <stdio.h>
  2.  
  3. struct Data{
  4. int day;
  5. int year;
  6. int month;
  7. };
  8. struct {
  9. int day;
  10. int year;
  11. int month;
  12. }ryaku ={31,2025,1};
  13. int main(void) {
  14. struct Data hinichi;
  15. hinichi.day=9;
  16. hinichi.year=2025;
  17. hinichi.month=1;
  18. printf("day%d\n",hinichi.day);
  19. printf("year%d\n",hinichi.year);
  20. printf("month%d\n",hinichi.month);
  21. struct Data today = {9,2025,1};
  22. printf("day%d\n",today.day);
  23. printf("year%d\n",today.year);
  24. printf("month%d\n",today.month);
  25. struct Data happy = today;
  26. printf("day%d\n",happy.day);
  27. printf("year%d\n",happy.year);
  28. printf("month%d\n",happy.month);
  29. printf("day%d\n",ryaku.day);
  30. printf("year%d\n",ryaku.year);
  31. printf("month%d\n",ryaku.month);
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
day9
year2025
month1
day9
year2025
month1
day9
year2025
month1
day31
year2025
month1