Таблица истинности приведена во втором вложении.
Var
i,n:integer;
begin
read(n);
for i := 1 to n do
if (i mod 2) * (i mod 3) * (i mod 5) = 0 then
write(i,' ')
<span>end.</span>
Using System;
public class Test
{
public static void Main()
{
double a, b, x, p=1;
int k=0;
Console.Write("a = ");
a = double.Parse(Console.ReadLine());
Console.Write("b = ");
b = double.Parse(Console.ReadLine());
for (int i=1; i <= 8; i++) {
x = double.Parse(Console.ReadLine());
if ((x>=a)&&(x<=b)){
k++; p*=x;
}
}
Console.WriteLine("k = {0} p = {1}", k,p);
Console.ReadKey();
}
}
Пример:
a = 3
b = 8
7
9
2
0
6
4
3
5
k = 5 p = 2520