valeriikozlov
4680 / 2506 / 322
Регистрация: 18.08.2009
Сообщений: 4,550
|
02.11.2009, 07:13
|
|
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
| #include <iostream.h>
#include <windows.h>
int main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
int i, j;
double mas[5][3], temp, max;
cout<<"Ââåäèòå ýëåìåГ*ГІГ» Г¬Г*Г±Г±ГЁГўГ*: "<<endl;
for(i=0; i<5; i++)
for(j=0; j<3; j++)
{
cout<<"ÝëåìåГ*ГІ ["<<i<<"]["<<j<<"]= ";
cin>>mas[i][j];
}
cout<<"ÈñõîäГ*ûé Г¬Г*Г±Г±ГЁГў: "<<endl;
for(i=0; i<5; i++)
{
for(j=0; j<3; j++)
cout<<mas[i][j]<<" ";
cout<<endl;
}
// 1 Г§Г*Г¤Г*Г*ГЁГҐ
for(i=0; i<3; i++)
{
temp=mas[0][i];
mas[0][i]=mas[4][i];
mas[4][i]=temp;
}
// 2 Г§Г*Г¤Г*Г*ГЁГҐ
for(i=0; i<5; i++)
for(j=0; j<3; j++)
mas[i][j]=5+ (1- mas[i][j]+mas[i][j]*mas[i][j])/6;
// 3 Г§Г*Г¤Г*Г*ГЁГҐ
max=mas[0][0];
for(i=0; i<5; i++)
for(j=0; j<3; j++)
if(max<mas[i][j])
max=mas[i][j];
cout<<"Ïîëó÷åГ*Г*ûé Г¬Г*Г±Г±ГЁГў: "<<endl;
for(i=0; i<5; i++)
{
for(j=0; j<3; j++)
cout<<mas[i][j]<<" ";
cout<<endl;
}
cout<<endl;
cout<<"ГЊГ*ГЄГ±ГЁГ¬Г*ëüГ*ûé ýëåìåГ*ГІ Г¬Г*Г±Г±ГЁГўГ*: "<<max<<endl;
return 0;
} |
|
0
|