include iostream include stdio include math using namespace std int ma

 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
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main()
{
setlocale(LC_CTYPE,"Russian");
float a,b,c,d,max1, max2;
cout<<"¬ведите a\t";
cin>>a;
cout<<"¬ведите b\t";
cin>>b;
cout<<"¬ведите c\t";
cin>>c;
cout<<"¬ведите d\t";
cin>>d;
if(a>b&&a>c&&a>d) {
max1=a;
if(b>c&&b>d) max2=b;
else if(c>b&&c>d) max2=c;
else if(d>b&&d>c) max2=d;
}
else if (b>a&&b>c&&b>d) {
max1=b;
if (a>c&&a>d) max2=a;
else if(c>a&&c>d) max2=c;
else if(d>a&&d>c) max2=d;
}
else if(c>a&&c>b&&c>d){
max1=c;
if(a>b&&a>d) max2=a;
else if(b>a&&b>d) max2=b;
else if(d>a&&d>b) max2=d;
}
else if(d>a&&d>b&&d>c)
{
max1=d;
if(a>b&&a>c) max2=a;
else if(b>a&&b>c) max2=b;
else if(c>a&&c>b) max2=c;
}
cout<<"ƒва наибольших числа:"<<max1<<"\t"<<max2;
return 0;
}
}