Поделитесь своими знаниями, ответьте на вопрос:
#include "iostream" #include "ctime" #include "cstdlib" using namespace std; int main() { int km = 0, kn = 0, a[20]; srand(time(NULL)); for (int& i : a)i = rand() % 100 - 50, cout 0; cout << "\n+: " << kn << ", -: " << km << '\n'; getchar(); } Создать алгоритм к данной программе
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Введите координату x точки");
double x = int.Parse(Console.ReadLine());
Console.WriteLine("Введите координату y точки");
double y = int.Parse(Console.ReadLine());
Console.WriteLine("Введите радиус");
double r = int.Parse(Console.ReadLine());
double d = Math.Sqrt(Math.Pow(-x, 2) + Math.Pow(-y, 2));
Console.WriteLine(d);
if (d < r){
Console.WriteLine("Да");}
else if (d == r){
Console.WriteLine("На границе");}
else{
Console.WriteLine("Нет");}
Console.ReadKey();
}
}