pelagia-kola2658
?>

Напишите программу: С клавиатуры вводится трёхзначное число (число десятков и число единиц не равна 0), проверить делится ли оно на каждую из своих цифр.

Информатика

Ответы

Егорова

Так как язык не указан, приведу пример на SWI-Prolog.

Код:

read_int(Int) :- read(Int), integer(Int).split_int_by_numbers(0, []) :- !.split_int_by_numbers(N, [Number|Ints]) :- Number is mod(N, 10), RestN is div(N, 10), split_int_by_numbers(RestN, Ints).test_to_div(_, []).test_to_div(N, [Number|Ints]) :- mod(N, Number) =:= 0, test_to_div(N, Ints). test(Int) :- split_int_by_numbers(Int, Numbers), test_to_div(Int, Numbers), write(Int), write(" - Yes!"), nl.test(Int) :- write(Int), write(" - No!"), nl.?- read_int(Int), test(Int).
Напишите программу: С клавиатуры вводится трёхзначное число (число десятков и число единиц не равна
Напишите программу: С клавиатуры вводится трёхзначное число (число десятков и число единиц не равна
Напишите программу: С клавиатуры вводится трёхзначное число (число десятков и число единиц не равна
Дмитриевич_Скрябин931

a - уровень продаж, а затем зп первого менеджераb - второго менеджераc - третьегоуровень продаж у всех разный.язык программирования: паскальvara, b, c: integer; beginreadln (a); if a < 500 thena : = 0.03 * a + 200; if (a > 500) and (a < 1000) thena : = 0.05 * a + 200; if a > 1000 thena : = 0.08 * a + 200; readln (b); if b < 500 thenb : = 0.03 * b + 200; if (b > 500) and (b < 1000) thenb : = 0.05 * b + 200; if b > 1000 thenb : = 0.08 * b + 200; readln (c);   if c < 500 thenc : = 0.03 * c + 200; if (c > 500) and (c < 1000) thenc : = 0.05 * c + 200; if c > 1000 thenc : = 0.08 * c + 200;   if (a > b) and (a > c) thena : = a +200; elseif b > c thenb : = b + 200; elsec : = c + 200; wreteln ('зп первого менеджера: ', a, '$'); wreteln ('зп второго менеджера:   ', b, '$');   wreteln ('зп третьего менеджера:   ', c, '$')end.

osipovasalex5316
  present simple общие does he go to school every day? does she really like singing? is it cold today? do cats catch mice? has he got a real friend? альтернативные does she go to shool every day or once a month? do cats catch mice or dogs? is the earth round or square? is russia bigger or smaller than other countries? does he like skiing or skating? специальные what does he do at school every day? who likes dancing? when does winter come? where does she live? what does she always wait for? present progressive общие is it raining now? is the sun shining at the moment? is he writing his composition now? are they swimming in the pool at the moment? are you doing your homework? альтернативные are you doing your homework or watching tv now? is it raining or snowing now? are they flying to italy or to canada now? is he reading a book or a web-page? is she clever or not? специальные what is she looking forward for? where are they going to go next summer? when is he leaving for france? whom is she writing an e-mail? what are they doing now?

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

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

Напишите программу: С клавиатуры вводится трёхзначное число (число десятков и число единиц не равна 0), проверить делится ли оно на каждую из своих цифр.
Ваше имя (никнейм)*
Email*
Комментарий*

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

maryshecka
kirillreznikov
Stryapunina
grishin
Rustamov741
nord0764
uksusoval617
Aivazyan
Беспалова
mira15963256
alexandergulyamov
Ольга1520
lbeglarova6
milo4ka26
iivanov54