Advertisement
Caneq

lb1.2.8

Oct 29th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. // lb1.2.8.cpp: определяет точку входа для консольного приложения.
  2. //
  3. #include "stdafx.h"
  4. #include <cmath>
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. int main() {
  9.     double r, x, y;
  10.     setlocale(LC_ALL, "rus");
  11.     cout << "Введите R, x, y" << endl;
  12.     cin >> r;
  13.     cin >> x;
  14.     cin >> y;
  15.     if ((pow(x + r, 2) + pow(y + r, 2) <= pow(r, 2) && y >= x) || (pow(x - r, 2) + pow(y - r, 2) <= pow(r, 2) && y <= x)) {
  16.         cout << "Точка (" << x << ";" << y << ") принадлежит заштрихованной области графика" << endl;
  17.     }
  18.     else {
  19.         cout << "Точка (" << x << ";" << y << ") не принадлежит заштрихованной области графика" << endl;
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement