64,631
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
using namespace std;
struct birthday
{
int year;
int month;
int day;
};
struct person
{
int age ;
struct birthday;
};
int main ()
{
struct person *p ;
struct person A;
p=&A ;
cin>>p->birthday.year;
cin>>p->birthday.month;
cin>>p->birthday.day;
cin>>p->
cout<<"----------出生信息-------------"<<endl;
cout<<p->birthday.year;
cout<<p->birthday.month;
cout<<p->birthday.day;
cout<<p->age;
return 0;
}
#include "stdafx.h"
#include<iostream>
using namespace std;
struct birthday
{
int year;
int month;
int day;
};
struct person
{
int age ;
struct birthday birth;
};
int main ()
{
struct person *p ;
struct person A;
p=&A ;
cin>>p->birth.year;
cin>>p->birth.month;
cin>>p->birth.day;
cout<<"----------出生信息-------------"<<endl;
cout<<p->birth.year;
cout<<p->birth.month;
cout<<p->birth.day;
cout<<p->age;
return 0;
}