#include<stdio.h>
#define LEN 20
const char *mgs[5]=
{
"qqqq","wwww","EEEEEEE","RRRR","TTTTT"
};
struct apple
{
char smell[LEN];
char taste[LEN];
};
struct fruit
{
struct apple greenapple;
char view[LEN];
float value;
};
main()
{
struct fruit ap={{"香","甜"},"好看",12.5};
printf("%s\n",ap.greenapple.smell);
printf("%s\n",ap.greenapple.taste);
printf("%s\n",ap.view);
printf("%.2f\n",ap.value);
printf("%s\n",mgs[0]);
printf("%s\n",mgs[3]);
printf("%s\n",mgs[4]);
}
#define LEN 20
const char *mgs[5]=
{
"qqqq","wwww","EEEEEEE","RRRR","TTTTT"
};
struct apple
{
char smell[LEN];
char taste[LEN];
};
struct fruit
{
struct apple greenapple;
char view[LEN];
float value;
};
main()
{
struct fruit ap={{"香","甜"},"好看",12.5};
printf("%s\n",ap.greenapple.smell);
printf("%s\n",ap.greenapple.taste);
printf("%s\n",ap.view);
printf("%.2f\n",ap.value);
printf("%s\n",mgs[0]);
printf("%s\n",mgs[3]);
printf("%s\n",mgs[4]);
}