Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //goo.gl/zKzUMZ
- int min(int a, int b) {
- if (a > b) {
- return b;
- }
- else return a;
- }
- int min4(int a, int b, int c, int d) {
- if ((min(a, b)) > c || (min(a, b)) > d) {
- if (c > d) {
- return d;
- }
- else return c;
- }
- else return (min(a, b));
- }
- int main()
- {
- int a, b, c, d;
- cin >> a >> b >> c >> d;
- cout << min4(a, b, c, d);
- return 0;
- }
- //goo.gl/nst98y
- double distance(double x1, double y1, double x2, double y2) {
- return sqrt((pow((x2 - x1), 2)) + (pow((y2 - y1), 2)));
- }
- int main()
- {
- double x1, y1, x2, y2;
- cin >> x1 >> y1 >> x2 >> y2;
- cout << distance(x1, y1, x2, y2);
- return 0;
- }
- //goo.gl/vhZP8V
- bool IsPointInSquare(double x, double y) {
- return ((abs(x)<= 1) && (abs(y)<= 1));
- }
- int main()
- {
- double x, y;
- cin >> x >> y;
- if (IsPointInSquare(x, y)) {
- cout << "YES";
- }
- else cout << "NO";
- return 0;
- }
- //goo.gl/Db8iHD
- bool IsPointInSquare(double x, double y) {
- return ((abs(x)<= 1) && (abs(y)<= 1) && (abs(x) + abs(y)<= 1));
- }
- int main()
- {
- double x, y;
- cin >> x >> y;
- if (IsPointInSquare(x, y)) {
- cout << "YES";
- }
- else cout << "NO";
- return 0;
- }
- //goo.gl/y4ar5q
- bool IsPointInCircle(double x, double y, double xc, double yc, double r) {
- return (pow(x - xc, 2) + pow(y - yc, 2) <= pow(r, 2));
- }
- int main()
- {
- double x, y, xc, yc, r;
- cin >> x >> y >> xc >> yc >> r;
- if (IsPointInCircle(x, y, xc, yc, r)) {
- cout << "YES";
- }
- else cout << "NO";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement