ekaterinkat
?>

Информатика Составьте программу нахождения произведения всех натуральных чисел из диапазона от А до В, включая А и В, кратных 2 и 3 одновременно(А и В вводятся с клавиатуры

Информатика

Ответы

сергеевич1958

program z1;

var i,a,b,p:integer;

begin

write('a = ');

readln (a);

write('b = ');

readln (b);

p:=1;

for i:=a to b do

if (i mod 2 = 0) and (i mod 3 =0) then p:=p*i;

if p <> 1 then writeln ('Произведение чисел, кратных 2 и 3 одновременно, равно ',p)

end.

Объяснение:

Если таких чисел нет, то программа ничего не выводит.

Если промежуток очень большой, то лучше изменить тип p (например, на real), чтобы не было переполнения.

Tuzov

1) 2,375+(х+1,627)=4,56

    х+1,627=4,56-2,375

    х+1,627= 2,185

    x=2,185-1,627 

    x=0,558

проверка:   2,375+( 0,558 +1,627)=4,56 

                    2,375+2,185=4,56

                    4,56=4,56

ответ: х=0,558

2,а) 8,6-(х+2,75)=1,85         проверка: 8,6-(4+2,75)=1,85 

        х+2,75=8,6-1,85                           8,6-6,75=1,85

        х+2,75 =6,75                                 1,85=1,85

        х=6,75-2,75

        х=4 

      ответ: х=4

  2,б) 5,732+(х+7,269)=645     проверка: 5,732+( 631,999 +7,269)=645 

          х+7,269=645-5,732                         5,732+639,268=645

          х+7,269=639,268                           645=645

          х=631,999

ответ:   х=631,999

  2,в) 29,1-(х+7,08)=6-4,357   проверка: 29,1-( 20,377 +7,08)=6-4,357 

          29,1-(х+7,08)=1,643                         29,1-27,457=1,643

          х+7,08=29,1-1,643                           1,643= 1,643  

          х+7,08=27,457

          х=  27,457- 7,08

          х=20,377

ответ:   х=20,377

vdk81816778

an ancient greek legend, the uninvited wedding goddess of discord and strife eris threw a wedding table a golden apple, on which was written a single word - "the most beautiful". were on olympus hera, athena and aphrodite arguing who should own this apple. each of them was rightfully deserves to own an apple, and even zeus refused to be their judge. he took the apple, gave it to hermes and told to withdraw goddesses in the neighborhood of troy, mount olympus, where they had to decide the dispute son of king priam of troy, paris. hera promised paris power over the whole of asia, athena - the glory and victory, and aphrodite promised him in marriage elenu.uslyhav wonderful promise of aphrodite, paris gave the apple of paris ey.afrodita helped kidnap helen, wife of spartan king menelaus, which later was the cause of the trojan war .

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

Информатика Составьте программу нахождения произведения всех натуральных чисел из диапазона от А до В, включая А и В, кратных 2 и 3 одновременно(А и В вводятся с клавиатуры
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

Yulechkaakulova1993
artmasterstyle
Nikita_Lina1305
cashuta
qwert28027170
pizzaverona
natalia595977
alexeylipatov
Eduardovich
gumirovane2294
Powerbasses5521
Korinchan390
kseniyavaganova
asyaurkova
blizzardtap641
▲