SHARE
TWEET

Untitled

a guest Oct 18th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function dividers(x: integer): integer;
  2. var s, i: integer;
  3. begin
  4. s := 0;
  5. for i := 1 to x - 1 do
  6. if x mod i = 0 then
  7. s := s + i;
  8. dividers := s
  9. end;
  10.  
  11. var
  12. a, b: integer;
  13.  
  14. begin
  15. Write('Введите два натуральных числа: '); Read(a, b);
  16. if (dividers(a) = b) and (dividers(b) = a) then
  17. WriteLn('YES')
  18. else
  19. WriteLn('NO');
  20. ReadLn
  21. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top