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.
nhìn mặc áo hình như trò chơi con mực đúng hông đấy là trò giết người hả
Tl :
Khong duoc viet lung tung tren dien dang
~ H T ~
quá dễ
bài 1:
uses crt;
var a,b:integer;
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
if a=0 then
if b=0 then writeln('phuong trinh co vo so nghiem')
else writeln('phuong trinh vo nghiem')
else writeln('phuong trinh co nghiem x=',-b/a:4:2);
readln;
end.
bài 2:
uses crt;
var x,y,a,b,ucln:integer;
{---------------------------------------------------------}
procedure nhap(var n:integer);
begin
write('nhap mot so nguyen bat ky='); readln(n);
end;
{---------------------------------------------------------}
procedure rutgon(var a,b:integer);
var x,y,ucln:integer;
begin
x:=a;
y:=b;
while x<>y do
begin
if x>y then x:=x-y
else y:=y-x;
end;
ucln:=x;
if ucln<>1 then
begin
a:=a div ucln;
b:=b div ucln;
writeln('phan so toi gian la: ',a,'/',b);
end
else writeln('phan so toi gian la: ',a,'/',b);
end;
{----------------------------------------------------------}
begin
clrscr;
nhap(a);
nhap(b);
rutgon(a,b);
readln;
end.
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 zoo;
var
i,n,k,d:integer;
a:array[1..32000] of integer;
function hello(x,y:integer):boolean;
begin
hello:=false;
if x mod y = 0 then hello := true
end;
begin
write(' nhap n: '); readln(n);
for i:= 1 to n do
begin
write(' nhap a[',i,'] = '); readln(a[i]);
end;
write(' nhap k = '); readln(k);
d:=0;
for i:= 1 to n do
if hello(a[i],k) = true then d:=d+1;
write(' so luong so chia het cho k la : ',d);
readln;
end.
const fi='k.inp';
fo='k.out';
var
i,n,k,d:integer;
a:Array[1..32000] of integer;
begin
assign(f,fi);
reset(f);
readln(f,n);
for i:= 1 to n do
read(f,a[i]);
readln(f);
read(f,k);
close(f);
assign(f,fO);
rewrite(f);
d:=0;
for i:= 1 to n do
if a[i] mod k = 0 then inc(d);
write(f,' co ',d,'so chia het cho',k);
close(f);
end.

m thì biết cái đ gì