1:
Mã:
uses crt;
var n: integer;
F: text;
function so_mu(a,b:integer):integer;
var ib, i: integer;
begin
ib:=1;
for i:=1 to b do
ib:=ib*a;
so_mu:=ib;
end;
function kiemtra(x: integer):integer;
var dv,j,s,i: integer;
a: array[1..5] of integer;
begin
i:=0;
s:=0;
while (x<>0) do
begin
dv:=x mod 10;
i:=i+1;
a[i]:=dv;
x:=x div 10;
end;
for j:=1 to i do
s:=s+so_mu(a[j],i);
kiemtra:=s;
end;
begin
clrscr;
assign(F,'Amstrong.inp');
reset(F);
read(F,n);
close(F);
assign(F,'Amstrong.out');
rewrite(F);
if kiemtra(n)=n then
writeln(F,'Yes')
else
writeln(F,'No');
close(F);
end.
2:
Mã:
Program super_spam;
Uses crt;
Var
F,F2:text;
i,n,gt:longint;
{--------------------------------------}
Procedure spam;
Begin
Assign(F1,'GGThua.inp');
Reset(F1);
Assign(F2,'GGThua.out');
Rewrite(F2);
Read(F,n);
If n mod 2=0 then
For i:=1 to n do
If i mod 2=0 then gt:=gt*i
Else
For i:=1 to n do
If i mod 2=1 then gt:=gt*i;
Write(F2,gt);
Close(F);
Close(F2);
End;
{--------------------------------------}
BEGIN
Clrscr;
spam;
END.
3:
Mã:
Uses crt;
Var
a,b,x:integer;
F:text;
{-----------------------------------------------------------------}
Procedure pt;
Var
d:integer;
Begin
Assign(F,'');
Reset(F);
Read(F,a,b,c,d);
Close(F);
If a=0 then write('Phuong trinh vo nghiem')
Else
Begin
D:=b*b-4*a*c;
If d=0 then write('Phuong trinh co nghiem kep x1=x2=',-b/(2*a));
If d<0 then write('Phuong trinh vo nghiem');
If d>0 then
Begin
Writeln('Phuong trinh co 2 nghiem phan biet:');
Write('x1=',(-b+sqrt(d))/(2*a));
Writeln;
Write('x2=',(-b-sqrt(d))/(2*a));
End;
End;
End;
{-----------------------------------------------------------------}
BEGIN
Clrscr;
pt;
END.
Để đáp ứng nhu cầu ngày càng đa dạng của khách hàng trong các lĩnh vực chuyên biệt, 3D Thinking đang tập trung phát triển các trung tâm dịch vụ chuyên sâu theo ngành. Mỗi trung tâm sẽ phụ trách...
Đưa công nghệ quét 3D vào lĩnh vực mỹ thuật và tạo hình