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
Stanislav Mykhailenko 94ae06e975
Add Lesson 1
2024-06-04 11:40:07 +03:00

30 lines
467 B
C++

#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;
}