Var x1,y1,x2,y2,x,y,x3,y3,x4,y4:integer; begin read(x1,y1,x2,y2,x,y); x3:=x1; y3:=y2; x4:=x2; y4:=y1; if (x<x1) and (y<=y3) and (y>=y1) then writeln('W') else if (x<x1) and (y>y3) then writeln('NW') else if (x>=x1) and (x<=x2) and (y>y3) then writeln('N') else if (x>x2) and (y>y3) then writeln('NE') else if (x>x2) and (y<=y2) and (y>=y4) then writeln('E') else if (x>x2) and (y<y4) then writeln('SE') else if (x<=x4) and (x>=x1) and (y<y4) then writeln('S') else if (x<x1) and (y<y1) then writeln('SW'); end.
#include <iostream>
using namespace std;
int main()
{
int YBorn , YNow ;
cout <<"what year where you born in?"<<endl;
cin >>YBorn;
cout <<"what year is it now?"<<endl;
cin >>YNow;
int YOld=YNow-YBorn;
cout<<"at the end of the year:"<<endl;
cout << "you're " <<YOld << " years old"<<endl;
int MOld = YOld*12;
cout<< "and "<<MOld<<" month old"<<endl;
int DOld=YNow/4-YBorn/4+YOld*365;
cout<<"and "<<DOld<<" days old"<<endl;
int HOld=DOld*24;
cout<<"and "<<HOld<<" hours old"<<endl;
int MinOld=HOld*60;
cout<<"and "<<MinOld<<" minutes old"<<endl;
int SOld=MinOld*60;
cout<<"and "<<SOld<<" seconds old"<<endl;
cout<<"and "<<SOld<<"000 miliseconds old"<<endl;
system("pause");
return 0;
}
Var x1,y1,x2,y2,x,y,x3,y3,x4,y4:integer;
begin
read(x1,y1,x2,y2,x,y);
x3:=x1;
y3:=y2;
x4:=x2;
y4:=y1;
if (x<x1) and (y<=y3) and (y>=y1) then writeln('W') else
if (x<x1) and (y>y3) then writeln('NW') else
if (x>=x1) and (x<=x2) and (y>y3) then writeln('N') else
if (x>x2) and (y>y3) then writeln('NE') else
if (x>x2) and (y<=y2) and (y>=y4) then writeln('E') else
if (x>x2) and (y<y4) then writeln('SE') else
if (x<=x4) and (x>=x1) and (y<y4) then writeln('S') else
if (x<x1) and (y<y1) then writeln('SW');
end.
Пример ввода:
-2 1 4 4 -3 5
Пример вывода:
NW