1. :
1. .
2. .
3. .
. () , .
struct Date //
{
int day;
int month;
int year;
};
Date birthday; // Date
. .
:
_._
// birthday
birthday.day=11; birthday.month=3; birthday.year=1993;
Date Data;
// birthday Data
Data=birthday;
.
Date mas[15]; //
//
for(int i=0;i<15;i++)
{
cout<<\nEnter day:;cin>>mas[i].day;
cout<<\nEnter month:;cin>>mas[i].month;
cout<<\nEnter year:;cin>>mas[i].year;
}
1. . .
2. .
3. , .
4. .
5. , .
6. .
7. .
8. .
struct person { char*name; char *adres; int age; }; | A | ||
struct date { int day; char*month; int year; }; | |||
struct student { char*name; int kurs; float rating }; | |||
struct employee { char*name; float salary; int stage }; | 10 | ||
struct pupil { char*name; int age; float rating }; | 4 | ||
struct person { char*name; int age; }; | 25 | ||
struct date { int day; char*month; int year; }; | 2000 | ||
struct student { char*name; int kurs; float rating }; | , 3 | ||
struct employee { char*name; float salary; int stage }; | , ˒ | ||
struct pupil { char*name; int age; float rating }; | , | ||
struct person { char*name; int age; }; | 18 | ||
struct date { int day; char*month; int year; }; | |||
struct student { char*name; int kurs; float rating }; | , 1 2 | ||
struct employee { char*name; float salary; int stage }; | 3 | , 1 2 | |
struct pupil { char*name; int age; float rating }; | 4.5 | , F | |
struct person { char*name; int age; }; | A | ||
struct date { int day; char*month; int year; }; | , | ||
struct student { char*name; int kurs; float rating }; | 3 | , A | |
struct employee { char*name; float salary; int stage }; | 10 15000 | ||
struct pupil { char*name; int age; float rating }; | 13 4 | ||
struct person { char*name; int age; }; | 25 C | ||
struct date { int day; char*month; int year; }; | 2000 | , N | |
struct student { char*name; int kurs; float rating }; | 1 2 , 3 | , N | |
struct employee { char*name; float salary; int stage }; | , ˒ 6000 | ||
struct pupil { char*name; int age; float rating }; | , 4 |
|
|
1. new, delete.
2. :
person make_person()
{
int Age; char Name[20];
cout<<"Name?";
cin>>Name;
cout<<"Age?";
|
|
cin>>Age;
person p;
p.name=new char[strlen(Name)+1];
strcpy(p.name,Name);
p.age=Age;
return p;
}
void print_person(person p)
{
cout<<"\nName: "<<p.name<<"\t"<<"Age: "<<p.age;
}
3. , , . main() .
5. , , , .
6. , . .
- ( ).
- .
- main().
7
++
1. :
1) ;
2) ;
3) .