#include <iostream>
using namespace std;
int main() {
double a, b, h, p, s,c,d;
cin >> a >> b >> c >> d >> h;
s = ((a + b) / 2) * h;
p = a + b + c + d;
cout << "S = " << s << endl;
cout << "P = " << p;
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int main() {
double a, b, h, p, s,c,d;
cin >> a >> b >> c >> d >> h;
s = ((a + b) / 2) * h;
p = a + b + c + d;
cout << "S = " << s << endl;
cout << "P = " << p;
}