fork download
  1. const n=10;
  2. var a:array[1..n,1..n] of real;
  3. fact,d, sum, k:real;
  4. i,j,c,b:integer;
  5. begin;
  6. fact:=1;
  7. for i:=1 to n do
  8. for j:=1 to n do
  9. begin
  10. b:=abs(i-j);
  11. for c:=1 to b do
  12. fact:=fact*c;
  13. if j mod 2=1 then d:=-1
  14. else d:=1;
  15. a[i,j]:=d*abs(i-j)*fact
  16. end;
  17. sum:=0;
  18. k:=0;
  19. for i:=1 to n do
  20. for j:=1 to n do
  21. begin
  22. if (i=j) and (a[i,j]>0) then
  23. begin
  24. sum:=sum+a[i,j];
  25. k:=k+1;
  26. end;
  27. end;
  28. writeln('Kolichestvo polizhitelnih chisel=',k);
  29. writeln('Summa polozhitelnyh chisel=',sum);
  30. end.
Success #stdin #stdout 0s 280KB
stdin
Standard input is empty
stdout
Kolichestvo polizhitelnih chisel= 0.00000000000000E+000
Summa polozhitelnyh chisel= 0.00000000000000E+000