Ответы 1

  • var u,s,r,a:byte;
    ussr,usa,peace:integer;
    begin
    for u:=1 to 9 do
     for s:=0 to 9 do
      for r:=0 to 9 do
       if (u<>s)and(u<>r)and(s<>r) then
        begin
        ussr:=u*1000+s*100+s*10+r;
        for a:=0 to 9 do
         if (a<>u)and(a<>s)and(a<>r) then
          begin
          usa:=u*100+s*10+a;
          peace:=ussr+usa;
          if (peace>9999)and(peace div 100 mod 10 = a)
             and(peace div 1000 mod 10 = peace mod 10)
              then writeln(u,s,s,r,'+',u,s,a,' = ',peace);
          end;
         end;
    end.

    Результат:
    9338+932 = 10270
    9447+943 = 10390
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years