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;
var a,b,c:array[1..100]of integer;
i,n,dem,dem1,kt,j:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
dem:=0;
for i:=1 to n do
if sqrt(a[i])=trunc(sqrt(a[i])) then
begin
inc(dem);
b[dem]:=a[i];
end;
dem1:=0;
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
begin
inc(dem1);
c[dem1]:=a[i];
end;
end;
if dem=0 then writeln('Trong day khong co so chinh phuong')
else begin
writeln('Cac so chinh phuong trong day la: ');
for i:=1 to dem do
write(b[i]:4);
end;
if dem1=0 then writeln('Trong day khong co so nguyen to')
else begin
writeln('Cac so nguyen to trong day la: ');
for i:=1 to dem1 do
write(c[i]:4);
end;
readln;
end.
#include <bits/stdc++.h>
using namespace std;
string n;
int main()
{
cin>>st;
int d=st.length();
for (int i=0; i<=d-1; i++)
if (st[i]==0) st[i]='5';
cout<<st;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
string n;
int main()
{
cin>>st;
int d=st.length();
for (int i=0; i<=d-1; i++)
if (st[i]==0) st[i]='5';
cout<<st;
return 0;
}
uses crt;
var a:array[1..100]of integer;
i,n,k,x,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n-1 do
for k:=i+1 to n do
if a[i]<a[k] then
begin
t:=a[i];
a[i]:=a[k];
a[k]:=t;
end;
writeln('Day giam dan la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
write('Nhap so nguyen x:'); readln(x);
i:=1;
while (x<a[i]) and (i<=n) do
inc(i);
for k:=n+1 downto i do
a[k]:=a[k-1];
a[i]:=x;
writeln('Day so duoc sap xep giam dan sau khi chen ',x,' la: ');
for i:=1 to n+1 do
write(a[i]:4);
readln;
end.