Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <iostream>
- #include <iomanip>
- #include <string>
- using namespace std;
- ////////////////////////
- void RusText(void);
- class PointRadio
- {
- public:
- double x;
- double y;
- double x0;
- double y0;
- double r0;
- int Res;
- PointRadio(double xx, double yy, double xx0, double yy0, double rr0)
- {
- x= xx; y= yy; x0= xx0; y0= yy0; r0= rr0;
- }
- void OutResult()
- {
- double g= (x-x0)*(x-x0)+(y-y0)*(y-y0); double r= r0*r0;
- if (r==g) Res=0;
- if (r<g) Res=-1;
- if (r>g) Res=1;
- cout<<"Точка x,y ("<<x<<","<<y<<")"<<endl;
- cout<<"Окружность x0,y0 ("<<x0<<","<<y0<<") и радиус r0= "<<r0<<endl;
- switch(Res)
- {
- case 0: cout<<"НА ГРАНИЦЕ окружности"<<endl;
- break;
- case 1: cout<<"ВНУТРИ окружности"<<endl;
- break;
- default:cout<<"ВНЕ окружности"<<endl;
- break;
- }
- }
- };
- ////////////////////////////////////////////////
- int main(int argc, char **argv)
- {
- RusText();
- PointRadio prIn(5,5,0,0,10); prIn.OutResult(); cout<<endl;
- PointRadio prBr(10,0,0,0,10); prBr.OutResult(); cout<<endl;
- PointRadio prOut(25,25,0,0,10); prOut.OutResult(); cout<<endl;
- cout<<endl; system("pause");
- return 0;
- }
- ////////// Руссификация сообщений //////////////////////////////////
- void RusText(void)
- {
- system("chcp 1251 > nul");
- SetConsoleTitle(TEXT("ОтветыМейлРу")); //Для совместимости с VS
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement