@newb_programmer
237 / 237 / 19
Регистрация: 03.09.2011
Сообщений: 557
|
07.10.2013, 00:29
|
|
Toda, вот сделал 6 первых, остальное влом менять сами попробуете
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
| #include <iostream>
#include <conio.h>
using namespace std;
struct students{
char fio[30];
int phys, math, ts, number_group;
float middle;
};
void main()
{
int size=10,n;
students* student=new students[size];
strcpy(student[1].fio, "Kurinnoy Oleg Vladimirovich");
student[1].phys=4;
student[1].math=3;
student[1].ts=4;
student[1].middle=(student[1].phys+student[1].math+student[1].ts)/3;
student[1].number_group=20;
strcpy(student[2].fio, "Trikulova Olga Olegovna");
student[2].phys=5;
student[2].math=3;
student[2].ts=4;
student[2].middle=(student[2].phys+student[2].math+student[2].ts)/3;
student[2].number_group=20;
strcpy(student[3].fio, "Melanchuk Artem Vitalievich");
student[3].phys=4;
student[3].math=3;
student[3].ts=3;
student[3].middle=(student[3].phys+student[3].math+student[3].ts)/3;
student[3].number_group=20;
strcpy( student[4].fio, "Danger Dasha Dmitrievna");
student[4].phys=4;
student[4].math=4;
student[4].ts=4;
student[4].middle=(student[4].phys+student[4].math+student[4].ts)/3;
student[4].number_group=21;
strcpy(student[5].fio, "Podtikan Dmitry Alexeevich");
student[5].phys=4;
student[5].math=3;
student[5].ts=4;
student[5].middle=(student[5].phys+student[5].math+student[5].ts)/3;
student[5].number_group=21;
strcpy(student[6].fio, "Dvortsov Alexand Viktorovich");
student[6].phys=5;
student[6].math=3;
student[6].ts=5;
student[6].middle=(student[6].phys+student[6].math+student[6].ts)/3;
student[6].number_group=21;
cout<<"Vvedite numer group: ";
cin>>n;
for (int i=0;i<6;i++){
if (student[i].number_group==n) {
cout<<student[i].fio;
cout<<student[i].number_group;
cout<<student[i].middle;
cout<<"\n";
}
}
getch();
} |
|
работает!
0
|