Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
uses crt;
const fo='de22.out';
var f1:text;
st:string;
begin
clrscr;
readln(st);
assign(f1,fo); rewrite(f1);
writeln(f1,st);
close(f1);
end.
uses crt;
var i,n,s: integer;
a:array[1..100] of integer;
begin
writeln('Nhap n: '); read(n);
for i:=1 to n do
begin
write('a[',i,'] = '); readln(a[i]);
end;
writeln('Cac so le: ')
s:=0;
for i:=1 to n do
if a[i] mod 2 <> 0 then
begin
s:=s+a[i];
write(a[i],' ');
end;
writeln('- Tong so le: ',s);
for i:=1 to trunc(sqrt(s)) do if s mod i = 0 then d:=d+1;
if d > 1 then writeln('Tong do khong la so nguyen to') else writeln('Tong do la so nguyen to');
readln
end.
var n,i,dem,t:integer;
a:array[1..50] of integer;
begin
dem:=0;
t:=0;
read(n);
for i:=1 to n do
read(a[i]);
for i:=n downto 1 do
write(a[i]);
writeln;
for i:=1 to n do
if (a[i] mod 2 = 0) then dem:=dem+1;
if a[i]<a[i-1] then t:=t+1;
writeln(dem);
if t=0 then write('Co lap thanh cap so +')
else write('Ko the lap thanh cap so +');
readln;
end.
Program HOC24;
var i,n: integer;
c: array[1..1000] of integer;
f: text;
begin
assign(f,'MANG3.TXT');
reset(f);
readln(f,n);
for i:=1 to n do read(f,c[i]);
close(f);
for i:=1 to n do if c[i] mod 2=1 then write(c[i],' ');
readln
end.
Bài 1:
uses crt;
var S:String;
vt:integer;
begin
clrscr;
Write(‘Nhap 1 xau:’); Readln(S);
While pos(‘nang’,s)>0 do
Begin
Vt:= pos(‘nang’,s);
Delete(s,vt,4);
Insert(‘mua’,s ,vt);
End;
Writeln(‘Xau sau khi thay the ’,s);
Readln;
End.
Bài 2:
uses crt;
var st:string;
d,i,kt:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
kt:=0;
for i:=1 to d do
if st[i]<>st[d-i+1] then kt:=1;
if kt=0 then writeln(st,' la xau doi xung')
else writeln(st,' khong la xau doi xung');
readln;
end.
cau 1:
uses crt;
var a:array[1..100] of integer;
n,i,min: integer;
begin
readln(n);
for i:=1 to n do
readln(a[i]);
min:=a[1];
for i:=2 to n do
if min>a[i] then min=a[i];
writeln(a[i]);
readln;
end.
cau 2:
uses crt;
g:text;
s:string;
const fo='CHUSO.TXT';
begin
assign(g,fo);
rewrite(g);
readln(s);
for i:=1 to length(s) do
if not((s[i] in ['a'..'z'])and(s[i] in ['A'..'Z])) then delete(s,i,1);
writeln(g,s);
end.