Предмет: Информатика, автор: danil212222222

Написать программу, которая в диапазоне от 1 до 100000 считает количество чисел, которые делятся на 8 без остатка.

Помогите пожалуйста.


danil212222222: Информатика | паскаль
LuciFear45: ааа... паскаль
danil212222222: ага )
LuciFear45: я на питоне написал :(
danil212222222: щас попробую на него
LuciFear45: лан ща загуглю синтаксис паскаля
danil212222222: =) спс
LuciFear45: Фух, сделал. Фиговый у паскаля синтаксис
LuciFear45: долго мучался
danil212222222: таков паскаль )

Ответы

Автор ответа: LuciFear45
0

Ответ:

Python:

d = 0

for i in range(1,100000):

   if i%8==0:

       d += 1

print(d)

Pascal:

var

i: integer;

d: integer;

begin

d:=0;

for i:=1 to 100000 do begin

 if (i mod 8) = 0 then

 begin

  d := d + 1;

 end;

end;

writeln(d)

end.

Если есть вопросы, пиши

Автор ответа: thejam2000000
0

Ответ:

Объяснение:

Java: https://pastebin.com/vVy4BLiE

Python: https://pastebin.com/Pyt3WjaE

Похожие вопросы
Предмет: Английский язык, автор: КанамиЧан
Предмет: Русский язык, автор: Nora1233
Предмет: Английский язык, автор: ilyagolovanov18
проверье сочинение что там не так?

Hello my name is Ilya and I want to tell you a story.
It happened in 1967 when I went to my uncle Stan. He lived in gravity falls, Oregon.
When I arrived, I did not find his uncle at his home. I was looking for it everywhere but not found. In the evening I went to bed and I had a dream, where I saw uncle and he was in the dark forest. This morning I woke up and went into the forest which was near the house.
Going into the forest, I heard a scream. I realized that it was uncle. I went on the road. As I walked I met a new friend. It was a dwarf. His name was Charlie. On the way he told me that this forest holds many secrets. In an hour we saw the Grand canyon. On the other side of the canyon was the uncle and I couldn't leave him. I didn't know what to do.Charlie blew a whistle and out of the bushes jumped a huge Minotaur. He broke the tree and made us a bridge. We thanked him and went on. After 3 km we saw the castle in which there was my uncle Stan. We went to the castle and saw a huge gargoyle who wanted to kill us. I was scared. Charlie again blew the whistle and the lock ran unicorns, zombies, Minotaur, 5 demons and 3 Goblin. This army was to kill the monster and help save uncle wall. The battle lasted 3 days and then consilia. The gargoyle died, and we saved uncle Stan.I asked him : What happened? How are you here turned out? but he didn't remember anything.
After 2 weeks I left gravity falls.I would like to come back here again, to unravel the secrets of this forest and to see you again Charlie. He promised to write me letters. I will never forget this adventure?.
Предмет: Английский язык, автор: D2009