Quipex

zadanie_3_II

Oct 22nd, 2015
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. // zadanie_3_II.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <clocale>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     setlocale(0,"rus");
  12.  
  13.     cout<<"Введите х и у через пробел:\n";
  14.     double x,y,r;
  15.     cin>>x>>y;
  16.     cout<<endl;
  17.     if((x<0) || (y<0))
  18.         cout<<"Не принадлежит\n";
  19.     else
  20.     {
  21.         r=pow(pow(x,2)+pow(y,2),1.0/2);
  22.         if((r>=0.5) && (r<=1))
  23.             cout<<"Принадлежит\n";
  24.         else
  25.             cout<<"Не принадлежит\n";
  26.     }
  27.     cout<<endl;
  28.     system("pause");
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment