Var a, max: integer;
begin
read(a);
max := -99999;
while(a <> 0) do
begin
if(a > max) then max := a;
read(a);
end;
writeln(max);
<span>end.</span>
//PascalABC.NET 3.2 сборка 1318
Var x1,y1,x2,y2,x,y,x3,y3,x4,y4:integer;
begin
read(x1,y1,x2,y2,x,y);
x3:=x1;
y3:=y2;
x4:=x2;
y4:=y1;
if (x<x1) and (y<=y3) and (y>=y1) then writeln('W') else
if (x<x1) and (y>y3) then writeln('NW') else
if (x>=x1) and (x<=x2) and (y>y3) then writeln('N') else
if (x>x2) and (y>y3) then writeln('NE') else
if (x>x2) and (y<=y2) and (y>=y4) then writeln('E') else
if (x>x2) and (y<y4) then writeln('SE') else
if (x<=x4) and (x>=x1) and (y<y4) then writeln('S') else
if (x<x1) and (y<y1) then writeln('SW');
end.
Пример ввода:
-2 1 4 4 -3 5
Пример вывода:
NW
Написал на c++ т,к синтаксис шарпа не знаю, можешь переделать под себя.
#include "pch.h"
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
int summa = 0;
int h;
int i = 1;
cout << "Введите h" << endl;
cin >> h;
for(i;summa<h;)
{
summa += i;
i++;
}
cout <<"Сумма= "<< summa << endl <<"Последнее слагаемое = "<< i - 1 << endl;
}
<span>6 8 7 9 8 10 9 11 10 12 сначало +2, потом уменьшаем на -12 4 3 5 4 6 5 7</span>