This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
NG_2024_Stanislav_Mykhailenko/Lesson_1/Task_7/main.cpp

31 lines
467 B
C++
Raw Normal View History

2024-06-04 08:40:07 +00:00
#include <cmath>
#include <iostream>
int main()
{
float x = 0;
float y = 0;
float N = 0;
float distance = 0;
std::cout << "x = ";
std::cin >> x;
std::cout << "y = ";
std::cin >> y;
std::cout << "N = ";
std::cin >> N;
if (x > N || y > N) {
std::cout << "Beyond radius." << std::endl;
return 1;
}
distance = sqrt(pow(x, 2) + pow(y, 2));
std::cout << distance << std::endl;
return 0;
}