Câu 1:
program ct;
uses crt;
var i,n:integer;
S:longint;
begin clrscr;
write('Nhap so n: '); readln(n);
S:=0; i:=0;
while i<=n do
begin
i:=i+1;
S:=S-(i*i*i-2);
end;
writeln('S= ',S);
readln;
end.
Câu 2:
program ct;
uses crt;
var i,n:integer;
begin clrscr;
write('Nhap so n: '); readln(n);
writeln('So ko chia het cho 3 nho hon ',n,' la: ');
i:=0;
while i<n do
if i mod 3<>0 then write(i:3);
readln;
end.
Học tốt!