Вопрос школьника по предмету Информатика
Вывести на экран все трехзначные натуральные числа, сумма цифр которых не превосходит заданное пользователем (введенное с клавиатуры) число.
Pascal ABC
срочно
для 8 класса функцией или процедурой
Ответ учителя по предмету Информатика
var s,i:integer;
begin
write(‘s = ‘);
readln(s);
for i:=100 to 999 do
if (i div 100 + i div 10 mod 10 + i mod 10 < s)
then write(i,’ ‘);
end.
Пример:
s = 5
100 101 102 103 110 111 112 120 121 130 200 201 202 210 211 220 300 301 310 400
Похожие вопросы от пользователей
Эссе на тему ,, Мой идеал лидера» (взять любого лидера)
Очень надо
Write the gender of the following words (Masculine, Feminine, Common or Neuter).1. niece 6. bull 11. lawn 16. monk2. husband 7. guest 12. princess 17. secretary3. shovel 8. nun 13. traveler 18. automobile4. scholar 9. bride 14. hotel 19. friend5. nephew 10. film 15. mistress 20. host
Complete each sentence.1. A _____________of cattle grazed in the savannah and a _____________ flock of egrets followed them. (flock, herd, group)2. Some ______________ left the football match as a ____________ of rioters stormed the field. (mob, spectators, audience)3. An emergency meeting was called by the ____________ of directors because the _____________ of players was dissatisfied. (team, board, coach)4. The ____________ of books was destroyed by the __________ of thieves. (gang, library, set)5. A ___________ of bees attacked the ____________ of pups in the backyard. (litter, herd, swarm)6. The ____________ of actors presented the director with a ____________ of flowers. (choir, bouquet, company)7. The ____________ of wolves wandered in the valleys while the ____________ ofmonkeys chattered in the treetops. (troop, herd, pack)8. The ____________ of musicians accompanied the ___________ of singers. (band,choir, company)9. As a ____________ of sailors disembarked, a ____________ of friends greeted.(party, fleet, crew)