, . , .
:
struct _
{_};
( ). . .
, :
|
struct student {char fam[30];
int kurs;
char grup[5];
float stip;};
student , . :
struct student stud1, stud2;
stud1 stud2 .
, , :
struct {char fam[30];
int kurs;
char grup[5];
float stip;
} stud1, stud2, *pst;
pst .
:
_. _
:
stud1.fam; stud1.stip;
, , . :
student stud1={, 3, 313, 350};
student *pst, stud1;
pst=&stud1;
stud1 . , fam
stud1.fam (*pst).fam pst->fam
: ->. .
. , 100 , :
student stud[100];
, , : stud[1].fam, stud[5].kurs .. 25- , : stud[25].fam[0].
1. N . , .
# include <stdio.h>
# include <conio.h>
void main()
{ const N=30; int i; long maxs;
struct student {char fam[15];
int kurs;
char grup[3];
long stip; };
student stud[N];
clrscr();
for (i=0; i<N; i++)
{ printf(%d- ,i);
printf(\n:); scanf(%s,&stud[i].fam);
printf(:); scanf(%d,&stud[i].kurs);
printf(:); scanf(%s,&stud[i].grup);
printf(:); scanf(%ld,&stud[i].stip); }
maxs=0;
for (i=0; i<N; i++)
if (stud[i].stip>maxs) maxs=stud[i].stip;
|
|
printf(\n , . %ld ., maxs);
for (i=0; i<N; i++)
if (stud[i].stip==maxs) printf(\n%s, stud[i].fam);}
1. .
2. .
3. .
1. ?
2. ?
3. ?
4. ?
5. ?
6. ?
7. ?
1. n , : , , , . , k . , .
2. n , : , , , . , . , .
3. N , , . : , , , ( ). , , , , . . , .
4. n , : , , , , , . ( ). , .
5. n , : , , , . , , . , .
6. . : , , . , ; .
7 15 , :
;
;
;
: , , , ;
.
, .
7. , 8, 9 10.
8. -, .
9. , 9 10.
10. , 9 10 .
11. , 4 5 .
|
|
12. .
13. , .
14. , 4.
15. , .
29