Для данных областей составить линейную программу, которая печатает true, если точка с координатами (х, у) принадлежит закрашенной области, и false — в противном случае: только c#!
class filledposition{ public float x {get; set; } public float y {get; set; } public filledposition(float xpos, float ypos) {x = xpos; y = ypos; } }
class znanija{ list positions = new list(); public bool checkfilled(float x, float y){ return positions.where(pos => pos.x = x & & pos.y = y).length ! = 0; }
объяснение:
точки надо ручками вводить)
Melnik Kaveshnikova1746
13.08.2021
Const n = 10; var a: array[1..n] of real; i: integer; begin for i : = 1 to n do begin a[i] : = random(100) - 50; write(a[i], ' '); end; writeln(); for i : = 1 to n do if i mod 2 = 0 then write(a[i], ' '); writeln(); for i : = 1 to n do if i mod 2 = 1 then write(a[i], ' '); end.
Femida76
13.08.2021
Var a: array[1..100] of integer; i, n: integer; begin n : = 50; writeln('данные массива: '); for i : = 1 to n do begin a[i] : = random(60); write(a[i], ' '); end; writeln(); {изменение элементов} writeln('новые значения: '); for i : = 1 to n do begin if a[i] mod 4 = 0 then a[i] : = 0; write(a[i], ' '); end; end.
ответ:
class filledposition{ public float x {get; set; } public float y {get; set; } public filledposition(float xpos, float ypos) {x = xpos; y = ypos; } }
class znanija{ list positions = new list(); public bool checkfilled(float x, float y){ return positions.where(pos => pos.x = x & & pos.y = y).length ! = 0; }
объяснение:
точки надо ручками вводить)