Program Tinhoc | Program Tinhoc; |
Var i,n,S:real | Var i,n,S:real |
Begin | Begin |
Write(nhap so); | Write("nhap so"); |
readln(n); | readln(n); |
i=1; | i:=1; |
while i<n | while i<n do |
begin | begin |
s:=s+i | s:=s+i; |
i:=i+1 | i:=i+1; |
end; | end; |
write('Ket qua la: ' S); | write('Ket qua la: ' ,S); |
readln; | readln; |
end | end. |