Skip to content

Instantly share code, notes, and snippets.

@tuankiet65
Created May 28, 2013 03:40
Show Gist options
  • Save tuankiet65/5660388 to your computer and use it in GitHub Desktop.
Save tuankiet65/5660388 to your computer and use it in GitHub Desktop.
program vnanswer;
uses crt;
var n, i: longint;
s, s1, s2: extended;
begin
clrscr;
write('Nhap n: ');
readln(n);
for i:=1 to n do begin
s1:=s1+(i*i);
s2:=s2+(i*(i+1));
end;
write('T=', (s1/s2):6:4);
readln;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment