![](https://rs.olm.vn/images/avt/0.png?1311)
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.
![](https://rs.olm.vn/images/avt/0.png?1311)
![](https://rs.olm.vn/images/avt/0.png?1311)
![](https://rs.olm.vn/images/avt/0.png?1311)
Câu 1:
const fi='dulieu.dat';
fo='thaythe.out';
var f1,f2:text;
a:array[1..100]of string;
n,d,i,vt:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
n:=0;
while not eof(f1) do
begin
n:=n+1;
readln(f1,a[n]);
end;
for i:=1 to n do
begin
d:=length(a[i]);
vt:=pos('anh',a[i]);
while vt<>0 do
begin
delete(a[i],vt,3);
insert('em',a[i],vt);
vt:=pos('anh',a[i]);
end;
end;
for i:=1 to n do
writeln(f2,a[i]);
close(f1);
close(f2);
end.
Câu 2:
uses crt;
const fi='mang.inp';
fo='sapxep.out';
var f1,f2:text;
a:array[1..100]of integer;
i,n,tam,j:integer;
begin
clrscr;
assign(f1,fi); rewrite(f1);
assign(f2,fo); rewrite(f2);
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n do
write(f1,a[i]:4);
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
for i:=1 to n do
write(f2,a[i]:4);
close(f1);
close(f2);
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
long long a,b,c,d,ln;
int main()
{
cin>>a>>b>>c>>d;
ln=a;
ln=max(ln,b);
ln=max(ln,c);
ln=max(ln,d);
cout<<ln;
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c, d, maxabcd;
cin >> a >> b >> c >> d;
maxabcd=a;
if(maxabcd<b) maxabcd=b;
if(maxabcd<c) maxabcd=c;
if(maxabcd<d) maxabcd=d;
cout << "Max=" << maxabcd << endl;
return 0;
}
Chúc bn học tốt!
![](https://rs.olm.vn/images/avt/0.png?1311)
29:
uses crt;
var n,i,j,kt:integer;
a:array[1..100]of integer;
begin
clrscr;
readln(n);
for i:=1 to n do
readln(a[i]);
for i:=1 to n do
if a[i]>1 then
begin
kt:=0;
for j:=2 to trunc(sqrt(a[i])) do
if a[i] mod j=0 then kt:=1;
if kt=0 then write(a[i]:4);
end;
readln;
end.
uses crt;
const fi='xau.doc';
var st:string;
f1:text;
i,d:integer;
begin
clrscr;
assign(f1,fi); rewrite(f1);
readln(st);
d:=length(st);
delete(st,1,3);
writeln(f1,st);
readln;
end.