Задание 1
10, 10, 11, 12, 10, 10, 11, 7, 7, 14
Вроде такой ответ :)
#include <iostream>
using namespace std;
int main() {
int a;
int max = -1000;
cout << "a = ", cin >> a;
while (a != 1000) {
if (a%10 == 0 && a>max) max = a;
cout << "a = ", cin >> a;
}
cout << "max = " << max << endl;
}
Пример:
<span>a = 138
a = 450
a = 981
a = 190
a = 409
a = 1000
max = 450</span>
// PascalABC.NET 3.1, сборка 1219 от 16.04.2016
begin
var n:=ReadInteger('Кол-во элементов:');
var a:=ArrRandomReal(n,-10,20); a.Println;
Writeln('С округлением если |x|<1');
for var i:=0 to n-1 do
if abs(a[i])<1 then a[i]:=Round(a[i]);
a.Println
end.
<u><em>Тестовое решение:</em></u>
Кол-во элементов: 10
-0.751956142835299 5.95022566427953 3.58861613254464 7.42331713783709 -4.75036238075717 -9.41228387384316 -0.700975591643235 3.85500546258642 -1.94321916994789 19.3021338336645
С округлением если |x|<1
-1 5.95022566427953 3.58861613254464 7.42331713783709 -4.75036238075717 -9.41228387384316 -1 3.85500546258642 -1.94321916994789 19.3021338336645
Program formula
var
x,y,z:integer;
begin
t:=0.5;
z:=6;
y:=t+2*z;
x:=(3*(y*y))/(4*z-2*(t*t));
writeln (x);
end.