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.
sqr(d) + b = 25 + 16 = 41
c*d + a = 40 + 31 = 71
41 >= 71 → D := FALSE
Sqrt(a) + b div k = 5 + 3 = 8
a mod b + c = 5 + 6 = 11
8 >= 11 → A := FALSE
Sqrt(A) + B div K = 7 + 1 = 8
A mod C + K = 1 + 4 = 5
8 >= 5 → B := TRUE
Bài 1:
program pstg;
uses crt;
var a,b,i,u : integer;
f : text;
BEGIN
clrscr;
assign(f,'PSTG.INP');
reset(f);
read(f, a);
read(f, b);
u:=1;
for i:= 1 to a do if ((a mod i)=0) and ((b mod i)=0) and (i>u) then u:=i;
a:= a div u;
b:= b div u;
assign(f,'PSTG.OUT');
rewrite(f);
write(f, a,' ',b);
close(f);
END.
bài 4 dễ ẹt à
uses crt;
const fi='quediem.inp';
fo='quediem.out';
var i,m,n,d,x,j,csc:longint;
a,b:array[1..1000]of integer;
f1,f2:text;
begin
clrscr;
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,n);
{-------------------------tim-so-lon-nhat--------------------------}
write(f2,'so lon nhat la: ');
m:=n;
if m mod 2=0 then
begin
for i:=1 to n div 2 do
write(f2,'1');
end
else begin
write(f2,'7');
for i:=2 to n div 2 do
write(f2,'1');
end;
{----------------------------tim-so-nho-nhat------------------------}
writeln(f2);
a[1]:=2; b[1]:=1;
a[2]:=5; b[2]:=2;
a[3]:=4; b[3]:=4;
a[4]:=6; b[4]:=6;
a[5]:=3; b[5]:=7;
a[6]:=7; b[6]:=8;
d:=(n div 7)+1;
if n mod 7=0 then d:=d-1;
if d=1 then begin
case n of
2:write(f2,'so nho nhat la: ',1);
3:write(f2,'so nho nhat la: ',7);
4:write(f2,'so nho nhat la: ',4);
5:write(f2,'so nho nhat la: ',2);
6:write(f2,'so nho nhat la: ',0);
7:write(f2,'so nho nhat la: ',8);
end;
end;
if d>1 then
begin
write(f2,'so nho nhat la: ');
for i:=1 to d do
if i=1 then begin
b[4]:=6;
for j:=1 to 6 do
begin
x:=n;
x:=x-a[j];
csc:=x div 7+1;
if x mod 7=0 then csc:=csc-1;
if csc=d-i then begin
write(f2,b[j]);
n:=x;
break;
end;
end;
end
else begin
a[1]:=6; b[1]:=0;
a[2]:=2; b[2]:=1;
a[3]:=5; b[3]:=2;
a[4]:=4; b[4]:=4;
a[5]:=3; b[5]:=7;
a[6]:=7; b[6]:=8;
for j:=1 to 6 do
begin
x:=n;
x:=x-a[j];
csc:=(x div 7)+1;
if x mod 7=0 then csc:=csc-1;
if csc=d-i then begin
write(f2,b[j]);
n:=x;
break;
end;
end;
end;
end;
close(f1);
close(f2);
readln;
end.
Program hotrotinhoc;
var a: byte;
i,n,p: longint;
t: int64;
begin
readln(a,n,p);
t:=1;
for i:=1 to n do
t:=t*a;
write(t mod 100);
readln
end.
Giờ thử chạy test này nhé: 25 9999999 125. (nếu qua được trước 0,5s code sẽ pass :>)
Program hotrotinhoc;
var d,n,i: byte;
a: array[1..100] of byte;
begin
write('N='); readln(n);
d:=0;
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
if a[i] mod 2=0 then inc(d);
end;
write('Mang vua nhap la :');
for i:=1 to n do write(a[i],' ');
writeln;
write('So phan tu chan la : ',d);
readln
end.
a mod c + d = 7 + 5 = 12
sqrt(b) + c = 4 + 8 = 12
12 >= 12 → C := TRUE