SlepoiKrot

Untitled

Jan 12th, 2018
76
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.  
  8. var
  9.   n, i, a, j: integer;
  10.   s: int64;
  11. begin
  12.   readln(n);
  13.   s := 0;
  14.   for i:=1 to n do begin
  15.     read(a);
  16.   for j:=1 to a-1 do
  17.     s:=s+j;
  18.   end;
  19.   writeln(s);
  20.   readln;
  21.   readln;
  22. end.
RAW Paste Data