Составить программу на языке c++ которая будет определять количество точек с целочисленными координатами принадлежащих кругу с радиусом R , с центром в начале координат.
int main() { int R; std::cout << "Enter the radius of the circle: "; std::cin >> R;
int count = 0; for (int x = -R; x <= R; x++) { for (int y = -R; y <= R; y++) { if (x * x + y * y <= R * R) { count++; } } } std::cout << "Number of points with integer coordinates inside the circle: " << count << std::endl; return 0;
int main() {
int count = 0;int R;
std::cout << "Enter the radius of the circle: ";
std::cin >> R;
for (int x = -R; x <= R; x++) {
for (int y = -R; y <= R; y++) {
if (x * x + y * y <= R * R) {
count++;
}
}
}
std::cout << "Number of points with integer coordinates inside the circle: " << count << std::endl;
return 0;
}