2 câu trả lời
program huyen;
var N,i : integer
S: longint
begin
write ('nhap so N=') ; readln(N);
S:=0
for i :=1 to N do S:=S+i;
writeln('tong cua',N', so tu nhien dau tien S=',S)
readln
end.
Program baitap;
Uses crt;
Var i,S:integer;
Begin
Clrscr;
S:=0;
For i:=1 to 10 do S:=S+i;
Writeln('Tong cac so nguyen tu 1 den 10:',S);
Readln
End.
Câu hỏi trong lớp
Xem thêm