versalmoda2971
?>

Министр финансов дурляндии выпустил в обращение только монеты достоинством в 7 и 11 дуриков. покупатель должен заплатить продавцу ровно 5 дуриков. сумеют ли они рассчитаться, если у каждого из них есть только по 4 монеты того и другого достоинства?

Информатика

Ответы

cardiodoc08
покупатель - 3*11 = 33; продавец - 4*7 = 28 (33-28 = 5)

покупатель - 4*11 = 44; продавец - 4*7+1*11 = 39 (44-39 = 5)
(Это, фактически, аналогично 1.)
Быстрее всего получилось решить с программы:
var a,b,c,d:integer;
begin
 for a:=0 to 4 do
  for b:=0 to 4 do
   for c:=0 to 4 do
    for d:=0 to 4 do
     if 7*a+11*b+5=7*c+11*d then writeln(a,b,c,d);
end.
lsuvorova1987
Var
A,B,C:integer;
Begin
C:=365;
Read(A,B);
if A>1 then C:=C-31;
if A=1 then C:=C-B;
if A>2 then C:=C-28;
if A=2 then C:=C-B;
if A>3 then C:=C-31;
if A=3 then C:=C-B;
if A>4 then C:=C-30;
if A=4 then C:=C-B;
if A>5 then C:=C-31;
if A=5 then C:=C-B;
if A>6 then C:=C-30;
if A=6 then C:=C-B;
if A>7 then C:=C-31;
if A=7 then C:=C-B;
if A>8 then C:=C-31;
if A=8 then C:=C-B;
if A>9 then C:=C-30;
if A=9 then C:=C-B;
if A>10 then C:=C-31;
if A=10 then C:=C-B;
if A>11 then C:=C-30;
if A=11 then C:=C-B;
if A>12 then C:=C-31;
if A=12 then C:=C-B;
Write(C);
End.
Fedorova_79166180822
Var a,d,count,i:integer;
function CountDay(a:integer):integer;
begin
if (a>=1) then countday:=31;
if (a>=2) then countday:=28;
if (a>=3) then countday:=31;
if (a>=4) then countday:=30;
if (a>=5) then countday:=31;
if (a>=6) then countday:=30;
if (a>=7) then countday:=31;
if (a>=8) then countday:=31;
if (a>=9) then countday:=30;
if (a>=10) then countday:=31;
if (a>=11) then countday:=30;
if (a>=12) then countday:=31;
end;
begin
count:=0;
write('Введите День: ');
readln(d);
write('Введите Месяц: ');
readln(a);
if (a<=0)or(a>12)or(d<=0)or(d>countday(a)) then
writeln('Ошшибка в данных! ')
else
begin
for i:=a to 12 do
count:=count+countday(i);
count:=count-d;
writeln('До нового года осталось ',count,' дней');
end;
end.

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

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

Министр финансов дурляндии выпустил в обращение только монеты достоинством в 7 и 11 дуриков. покупатель должен заплатить продавцу ровно 5 дуриков. сумеют ли они рассчитаться, если у каждого из них есть только по 4 монеты того и другого достоинства?
Ваше имя (никнейм)*
Email*
Комментарий*

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

annaar497
horst58
drevile57
Лихачев Полина1978
Pochkun-Oleg
Бисеров-Чистякова
boldyrevanastia22
sakalrip
leonidbaryshev19623
dksvetlydir
proh-dorohova5244
rmitin
An-solomon
Maionova
goodsled