var a,b,c,d,res: integer;
begin
write('Введите a: ');
readln(a);
write('Введите b: ');
readln(b);
write('Введите c: ');
readln(c);
write('Введите d: ');
readln(d);
res := a;
// Проверяем число b
if (b mod 10 > res mod 10) then res:=b
else if (b mod 10 = res mod 10) then
begin
if (res<b) then res:=b;
end;
// Проверяем число c
if (c mod 10 > res mod 10) then res:=c
else if (c mod 10 = res mod 10) then
begin
if (res<c) then res:=c;
end;
// Проверяем число d
if (d mod 10 > res mod 10) then res:=d
else if (d mod 10 = res mod 10) then
begin
if (res<d) then res:=d;
end;
writeln('Число с наибольшей последней цифрой: ',res);
end.
var a,b,c,d,res: integer;
begin
write('Введите a: ');
readln(a);
write('Введите b: ');
readln(b);
write('Введите c: ');
readln(c);
write('Введите d: ');
readln(d);
res := a;
// Проверяем число b
if (b mod 10 > res mod 10) then res:=b
else if (b mod 10 = res mod 10) then
begin
if (res<b) then res:=b;
end;
// Проверяем число c
if (c mod 10 > res mod 10) then res:=c
else if (c mod 10 = res mod 10) then
begin
if (res<c) then res:=c;
end;
// Проверяем число d
if (d mod 10 > res mod 10) then res:=d
else if (d mod 10 = res mod 10) then
begin
if (res<d) then res:=d;
end;
writeln('Число с наибольшей последней цифрой: ',res);
end.
Объяснение:
#include <iostream>
int main() {
for (int i = 35; i <= 87; i ++) {
if (i % 7 == 1 || i % 7 == 2 || i % 7 == 5) {
std::cout << i << " ";
}
}
}