Объяснение:
#include <bits/stdc++.h>
using namespace std;
int bigger_P(int a, int b, int c, int d)
{
if(a+b+sqrt(pow(a, 2)+pow(b, 2))>c+d+sqrt(pow(c, 2)+pow(d, 2)))return 1;
if(a+b+sqrt(pow(a, 2)+pow(b, 2))<c+d+sqrt(pow(c, 2)+pow(d, 2)))return 0;
return -1;
}
int main()
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int a, b, c, d;
cin>>a>>b>>c>>d;
if(bigger_P(a, b, c, d)==1)cout<<"First perimetr is bigger.";
if(bigger_P(a, b, c, d)==0)cout<<"Second perimetr is bigger.";
if(bigger_P(a, b, c, d)==-1)cout<<"They are equal.";
return 0;
Объяснение:
#include <bits/stdc++.h>
using namespace std;
int bigger_P(int a, int b, int c, int d)
{
if(a+b+sqrt(pow(a, 2)+pow(b, 2))>c+d+sqrt(pow(c, 2)+pow(d, 2)))return 1;
if(a+b+sqrt(pow(a, 2)+pow(b, 2))<c+d+sqrt(pow(c, 2)+pow(d, 2)))return 0;
return -1;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int a, b, c, d;
cin>>a>>b>>c>>d;
if(bigger_P(a, b, c, d)==1)cout<<"First perimetr is bigger.";
if(bigger_P(a, b, c, d)==0)cout<<"Second perimetr is bigger.";
if(bigger_P(a, b, c, d)==-1)cout<<"They are equal.";
return 0;
}