thiennaha 5/20/2024 9:43:26 PM
chuyen sang c++ program baitap; uses crt; var x,y,i,m,t: Integer; begin clrscr; writeln('Nhap so tu nhien x: '); readln(x); while (x < 4) or (x > 53) do begin writeln('Ban chi duoc nhap 4 <= x < 53, vui long nhap lai: '); readln(x); end; writeln('Nhap so tu nhien y: '); readln(y); while (y < 59) or (y > 121) do begin writeln('Ban chi duoc nhap 59 < y <= 121, vui long nhap lai: '); readln(y); end; writeln(); writeln('Cac so le chia het cho 3 tu x den y la: '); for i := x to y do begin if (i mod 2 <> 0) then begin if (i mod 3 = 0) then write(i,' '); end; end; writeln(); t := 0; writeln(); writeln('Cac so chinh phuong m voi x < m < y la: '); for i := x+1 to y-1 do begin m := round(sqrt(i)); if (m*m = i) then begin t := t + 1; write(i,' '); end; end; writeln(); writeln('Co tat ca la ',t,' so chinh phuong'); readln; end.