fork download
  1. program stairway;
  2. var N : integer;
  3. B : int64;
  4. begin
  5. readln(N);
  6. B:=N*(N+1) div 2;
  7. writeln(B);
  8. end.
Success #stdin #stdout 0.01s 5292KB
stdin
987 
stdout
487578