Phạm Thanh Bình
(foxhater)
New Member
đây là bài tiền điện
đầy đủ những gì lão tuấn yêu cầu
dài vãi chốt
----------
đây là bảng cửu chương
----------
đây là bài tổng 2 cs đầu bằng tổng 2 cs cuối
đầy đủ những gì lão tuấn yêu cầu
dài vãi chốt
Mã:
program dmtuan;
uses crt;
var ss,sd,sc,tien,i,j:longint;
m,y:integer;
thgd,ch:char;
begin
repeat
clrscr;
write('Nhap thang, nam:'); readln(m,y);
write('Nhap ten ho gia dinh:'); readln(thgd);
write('Nhap chi so cong to dau:'); readln(sd);
write('Nhap chi so cong to cuoi:'); readln(sc);
if sd<sc then
begin
clrscr;
ss:=sc-sd;
gotoxy(2,2);write('Hoa don tien dien':44);
gotoxy(2,3);write('Thang ',m:2,' nam ',y:5);
gotoxy(2,4);write('Ten ho gia dinh: ',thgd);
gotoxy(1,1);
for i:=1 to 70 do write('-');
gotoxy(1,20);
for i:=1 to 70 do write('-');
gotoxy(1,5);
for i:=1 to 70 do write('-');
gotoxy(1,7);
for i:=1 to 70 do write('-');
gotoxy(1,9);
for i:=1 to 22 do write('-');
gotoxy(23,14);
for i:=23 to 70 do write('-');
gotoxy(23,16);
for i:=23 to 70 do write('-');
gotoxy(23,18);
for i:=23 to 70 do write('-');
for i:=1 to 19 do
begin
gotoxy(1,i);write('!');
gotoxy(70,i);write('!');
if i>4 then
begin
{ if i<10 then gotoxy(12,i);write('!');}
gotoxy(23,i);write('!');
gotoxy(50,i);write('!');
if i<17 then
begin
gotoxy(30,i);write('!');
gotoxy(42,i);write('!');
end;
end;
end;
for i:=5 to 9 do begin gotoxy(12,i);write('!'); end;
gotoxy(2,6);write('Chi so dau');
gotoxy(13,6);write('Chi so sau');
gotoxy(24,6);write('He so');
gotoxy(31,6);write('DN tieu thu');
gotoxy(43,6);write('Don gia');
gotoxy(51,6);write('Thanh tien':15);
gotoxy(1,8);
write('!',sd:10,'!',sc:10,'!','1!':7,ss:11,'!');
gotoxy(24,9); write('Tr.do:');
if ss<=100 then tien:=ss*550;
if (ss>100) and (ss<=150) then tien:=100*550+(ss-100)*900;
if (ss>150) and (ss<=200) then tien:=100*550+50*900+(ss-150)*1210;
if (ss>200) and (ss<=300) then tien:=100*550+50*900+50*1210+(ss-200)*1340;
if (ss>300) and (ss<=400) then tien:=200*1100+100*1340+(ss-300)*1400;
if (ss>400) then tien:=200*1100+100*1340+100*1400+(ss-400)*1500;
if ss<= 300 then
begin
gotoxy(43,9); write(550:7);
if ss<=100 then begin gotoxy(31,9); write(ss:11);
gotoxy(51,9); write(ss*550:19);
end
else begin gotoxy(31,9); write(100:11);
gotoxy(51,9); write(100*550:19);
end;
if ss>=150 then begin gotoxy(31,10); write(50:11); gotoxy(43,10); write(900:7);
gotoxy(51,10); write(900*50:19);
end
else begin gotoxy(31,10); write(ss-100:11); gotoxy(43,10); write(900:7);
gotoxy(51,10); write((ss-100)*900:19);
end;
if ss>=200 then begin gotoxy(31,11); write(50:11); gotoxy(43,11); write(1210:7);
gotoxy(31,12); write(ss-200:11); gotoxy(43,12); write(1340:7);
gotoxy(51,11); write(50*1210:19);
gotoxy(51,12); write((ss-200)*1340:19);
end
else begin gotoxy(31,11); write(ss-150:11); gotoxy(43,11); write(1210:7);
gotoxy(51,11); write((ss-150)*1210:19);
end;
end;
if ss>300 then
begin
gotoxy(31,9); write(200:11);
gotoxy(51,9); write(200*1100:19);
gotoxy(43,9); write(1100:7);
gotoxy(31,10); write(100:11);
gotoxy(51,10); write(100*1340:19);
gotoxy(43,10); write(1340:7);
if ss>=400 then begin gotoxy(31,11); write(100:11); gotoxy(43,11); write(1400:7);
gotoxy(31,12); write(ss-400:11); gotoxy(43,12); write(1500:7);
gotoxy(51,11); write(100*1400:19);
gotoxy(51,12); write((ss-300)*1400:19);
end
else begin gotoxy(31,11); write(ss-300:11); gotoxy(43,11); write(1400:7);
gotoxy(51,11); write((ss-300)*1400:19);
end;
end;
gotoxy(25,15); write('Cong !',288:11,'!','!':8,tien:19);
gotoxy(24,17); write('Thue GTGT (10%):');gotoxy(51,17); write(round(tien/10):19);
gotoxy(24,19); write('Tong cong tien thanh toan');gotoxy(51,19); write(round(tien*11/10):19);
end
else writeln('Nhap du lieu sai');
writeln;
gotoxy(1,21);
write('Co tinh tiep khong? (C/K) ');readln(ch);
until (ch='k') or (ch='K');
end.
đây là bảng cửu chương
Mã:
program bangcuuchuong;
uses crt;
var i,j,x,y:integer;
begin
clrscr;
x:=10;
y:=4;
for i:=1 to 9 do
begin
for j:=1 to 9 do begin gotoxy(x,y+j-1); write(i:2,'x',j:2,'=',i*j:2); end;
x:=x+24;
if x>70 then begin x:=10; y:=y+15 end;
end;
readln;
end.
đây là bài tổng 2 cs đầu bằng tổng 2 cs cuối
Mã:
program cs;
uses crt;
var so,c1,c2,c3,c4,m:integer;
begin
clrscr;
for m:=1000 to 9999 do
begin
so:=m;
c1:=so div 1000;
so:=so mod 1000;
c2:=so div 100 ;
so:=so mod 100 ;
c3:=so div 10 ;
so:=so mod 10 ;
c4:=so ;
if (c1+c2)=(c3+c4) then write(m:5);
end;
readln;
end.
Chỉnh sửa lần cuối: