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

Используя признаки делимости, написать программу в паскале, которая проверяет, делится ли натуральное число k на 4 (две последние цифры нули или образуют число, делящееся на 4).

Ответы

Автор ответа: ябloko
1
program qwerty;
var k, a:integer;
begin
readln(k);
a:=k mod 100;
if(a=0) or (a mod 4=0) then write('Да')
else write('Нет')
end.
Автор ответа: Аноним
0
PascalABC.NET 3.3.5, сборка 1660 от 20.04.2018
Внимание! Если программа не работает, обновите версию!

begin
  var k:=ReadInteger('n=');
  var a:=k mod 10; // поледняя цифра
  var b:=(k mod 100) div 10; // предпоследняя цифра
  if (a=0) and (b=0) or ((10*b+a) mod 4=0) then Writeln('Делится на 4')
  else Writeln('Не делится на 4')
end.

Пример
n= 567264
Делится на 4
Похожие вопросы
Предмет: Английский язык, автор: romannikov08
Choose the sentence or sentences in the Present Perfect Tense


1. a) Nick travelled to China last month.

b) Nina has got a friend.

c) We are playing at the moment.

d) We were at home yesterday.

e) I have already been to Spain.

2. a) We did not cook last Tuesday.

b) They are not doctors.

c) He has not bought anything.

d) I was a good pupil at school.

e) People are waiting for the bus.

3. a) He went to the swimming-pool last week.

b) I have got a good family.

c) They did not spend all their money yesterday.

d) Mike has already read five books.

e) What are you looking at?

4. a) We have never been to Moscow.

b) She was cooking at this time yesterday.

c) Tom went to school yesterday.

d) We bought a car last month.

e) I don’t like singing.

5. a) Did they go to the seaside last summer?

b) Was he lucky at the exam?

c) Has she ever travelled abroad?

d) Were you late yesterday?

e) Why are you crying?


Open the brackets using the Present Perfect Tense


6. Helen (to cook) a delicious cake.

7. The Browns (to move) to a new flat.

8. I (to visit) already this museum.

9. Parents (to bring) just a big box.

10. Liz (not to eat) her lunch today.

11. They (to buy) a car?

12. Ted (not to be) to Italy yet.

13. All the pupils (to be present) at the lesson today?

14. My friends (to solve) already their problems.

15. She (to learn) the poem by heart?


Put up questions to the underlined words


16. She has already sent him a birthday card.

17. Pupils have just left the classroom.

18. Mary hasn’t been to Egypt yet. (General)

19. He has come because he needs help.

20. Children have spent all their pocket money.


Translate the sentences into English using the Present Perfect Tense


21. Ты его видел на этой неделе?

22. Мы никогда не были в Китае.

23. Она недавно посетила три музея.

24. Кто купил этот дом?

25. Он еще не приходил.

26. Где вы провели каникулы?

27. Я уже полила цветы.

28. Дети не ходили на прогулку с понедельника.

29. Маша навестила бабушку в этом месяце.

30. Они прожили в этом доме 5 лет.





Предмет: Математика, автор: gelyagalkina2000