SlepoiKrot

Untitled

Jan 8th, 2018
73
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program Project2;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6.   SysUtils;
  7. var
  8.   n, i: integer;
  9.   a, sum: int64;
  10. begin
  11.   readln (n);
  12.   sum := 0;
  13.   for i := 1 to n do begin
  14.     read (a);
  15.     sum := sum + (a * (a - 1)) div 2;
  16.   end;
  17.   writeln (sum);
  18.   readln;
  19.   readln;  
  20. end.
RAW Paste Data