在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
#include <stdio.h> struct Person { char name[10]; char characteristic[20]; struct Birthday { //嵌套了一个struct char month[10]; int day; int year; } birthday; int age; }; int main() { struct Person man1 = {"jerry", "fastidious", {"June", 4, 1965}, 34}; //注意这里的对应顺序,可以用curly brace把Birthday括起来 printf("My name is %s, I was born on %s-%d-%d, so I'm %d years old. My friends always complain I'm so %s\n.", \ man1.name, man1.birthday.month, man1.birthday.day, man1.birthday.year, man1.age, man1.characteristic); return 0; }
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论