Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main() {
- int x1,y1,x2,y2,dl,sh,S,P;
- cout <<"Vvedite pervie koordinati" << endl;
- cin >> x1;
- cin >> y1;
- cout << "Vvedite vtorie koordinati" << endl;
- cin >> x2;
- cin >> y2;
- if (x1 > x2) dl = x1 - x2;
- else dl = x2 - x1;
- if (y1 > y2) sh = y1 - y2;
- else sh = y2 - y1;
- S = sh * dl;
- P = (sh + dl) * 2;
- cout << "Ploshad ="<< S << endl << "Perimetr="<< P;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement