Affiliates

code chương trình Pupil trên phòng máy

Xem chủ đề cũ hơn Xem chủ đề mới hơn Go down

trợ giúp code chương trình Pupil trên phòng máy

Bài gửi by Administrator on Mon Jan 30, 2012 8:02 pm

nó trông còn thấp bậc hơn cả cái password Very Happy nhưng lúc đấy mình cũng chỉ viết được thế này, các bạn lấy về tham khảo cũng tạm đấy
USES crt;
VAR
tep,tep1,tep3,tep2,tep4,tep5,tep6:TEXT;
tepchuyen,vc,vcx,tuy,cau,tro:TEXT;
e,i:LONGINT;
caudo,vcxz:STRING;
note,chontro:CHAR;
t,noi,u,ngaysinh,qwe,hoi,tenchuyen:STRING;
q,toi,hoc,chon,chonvatli,chontoan:CHAR;
chonchuyen,chontr,choncau:CHAR;
w:LONGINT;
tendang,lop,s,z,gioitinh:STRING;
r:ARRAY[1..205]OF STRING;
BEGIN
REPEAT
textmode(30000);
writeln('0-> thoat');
writeln;
writeln('1-> dang nhap');
writeln;
writeln('2-> dang ki');
q:=readkey;
CASE q OF
'1':BEGIN
clrscr;
write('ten dang nhap:');
readln(tendang);
write('nhap mat khau:');
w:=14;
FOR e:=1 TO 255 DO
BEGIN
w:=w+1;
r[e]:=readkey;
gotoxy(w,wherey);
IF r[e]=#8 THEN
BEGIN
IF w=15 THEN BEGIN r[e]:=readkey END ELSE
BEGIN
w:=w-2;
gotoxy(w,wherey);
clrEol;
END;
END;
IF r[e]=#13 THEN break;
IF r[e]=#8 THEN delete(t,length(t),1) ELSE t:=t+r[e];

IF w<=14 THEN write(':') ELSE write(#15);
END;
IF (tendang='admin')AND(t='tuaninformatics') THEN
BEGIN
REPEAT
clrscr;
writeln('1-> chat');
writeln;
writeln('2-> tai lieu');
writeln;
writeln('3-> hoc tap');
writeln;
writeln('4-> giai tri/thu gian');
writeln;
writeln('0-> thoat');
toi:=readkey;
CASE toi OF
'1':
BEGIN
clrscr;
writeln('chao ',tendang,' da tro lai dien dan!');
delay(5000);
assign(tep,'e:\chat.pas');
reset(tep);
WHILE NOT eof(tep) DO
BEGIN
readln(tep,s);
writeln(s);
END;
append(tep);
writeln;
writeln;
writeln;
REPEAT
writeln;
write(tendang,':');
readln(noi);
IF noi='het' THEN break;
IF length(noi)>0 THEN writeln(tep,tendang,':',noi);
UNTIL noi='het';
close(tep);
END;
'2':
BEGIN
REPEAT
clrscr;
writeln('0-> thoat');
writeln('1-> lenh de che{khong phai tat ca}');
writeln('2-> lenh cuop duong pho{khong phai tat ca}');
writeln('3-> lenh game ban quai vat{alien}');
writeln('4-> mot it lenh half life');
writeln('5-> web game');
q:=readkey;
CASE q OF
'1' : BEGIN
clrscr;
assign(tep3,'e:\lenh.pas');
reset(tep3);
WHILE NOT eof(tep3) DO
BEGIN
readln(tep3,s);
writeln(s);
END;
readln;
close(tep3);
END;
'2':BEGIN
clrscr;
assign(tep2,'e:\cuope.pas');
reset(tep2);
WHILE NOT eof(tep2) DO
BEGIN
readln(tep2,s);
writeln(s);
END;
readln;
close(tep2);
END;
'3':
BEGIN
clrscr;
assign(tep4,'e:\ban.pas');
reset(tep4);
WHILE NOT eof(tep4) DO
BEGIN
readln(tep4,s);
writeln(s);
END;
readln;
END;
'4':
BEGIN

clrscr;
assign(tep5,'e:\hap.pas');
reset(tep5);
WHILE NOT eof(tep5) DO
BEGIN
readln(tep5,s);
writeln(s);
END;
readln
END;
'5':
BEGIN
clrscr;
writeln('ten web |danh gia{sao}');
writeln('________________________________________');
writeln('tro choi viet.com |+ ');
writeln('mezing.com.vn |++ ');
writeln('vuong wuoc game |+++++ ');
writeln('truyen thuyet rong |+++++');
writeln('linh vuong |++++++++++ ');
writeln('de che quat khoi |++++++++ ');
writeln('gladiatus |+++++');
writeln('anh hung online |+++');
writeln('vua phap thuat |+++++');
writeln('hattrick |++++++');
writeln('lkariam |0');
writeln('warcity-online |0');
writeln('ongame |++++');
readln;
END;
END;
UNTIL q='0';

END;
'3': BEGIN
REPEAT
clrscr;
writeln('0-> thoat');
writeln('1-> vat li ');
writeln('2-> hoa hoc');
writeln('3->tieng anh');
chon:=readkey;
CASE chon OF
'1':
BEGIN
clrscr;
writeln('1->lop 8');
writeln('2->lop 6');
chonvatli:=readkey;
CASE chonvatli OF
'1':
BEGIN
clrscr;
writeln('cong thuc tinh ap xuat:p=f/s');
writeln('cong thuc tinh ap xuat chat long:p=d.h');
writeln('cong thuc tinh luc day acsimet:Fa=D.v');
writeln('cong thuc tinh cong co hoc: A=F.s');
writeln('cong thuc tinh cong suat:P=A/t');
writeln('hieu suat cua dong co nhiet:H=A/Q');
readln;
END;
'2':BEGIN
clrscr;
writeln('Trong luong: P = 10 x m (N)');
writeln('Trong luong rieng: d = P/V hoac d = D x 10 (N/m3)');
writeln('Khoi luong: m = D x V (kg)');
writeln('Khoi luong rieng: D = m/V (kg/m3)');
writeln('The tich: V = m : D hoac P : d (m3)');
writeln('muon tinh do C sang do F thi cong them 273');
readln;
END;
END;
END;
'2':
BEGIN
clrscr;
writeln('tinh so mol:n=m/M');
writeln('tinh the tich{dktc}:v=n.22,4');
writeln('tinh so nguyen tu/phan tu :n.6.10^23');
writeln('dinh luat bao toan khoi luong:tong khoi luong chat tham gia=tong khoi luong chat san pham');
readln;
END;
'3':
BEGIN
clrscr;
assign(tep6,'e:\tieng.pas');
reset(tep6);
WHILE NOT eof(tep6) DO
BEGIN
readln(tep6,s);
writeln(s);
END;
readln;
END;
END;
UNTIL chon='0';
END;
'4':
BEGIN
REPEAT
clrscr;
writeln('0-> thoat');
writeln;
writeln('1-> truyen cuoi');
writeln;
writeln('2-> cau do ');
writeln;
writeln('3-> danh dan');
writeln;
writeln('4-> mot vai tro nghic hay khi len mang');
writeln;
chontr:=readkey;
CASE chontr OF
'1':BEGIN
clrscr;
writeln('1-> doc truyen 2-> dang truyen 0-> thoat');
chonchuyen:=readkey;
CASE chonchuyen OF
'1':
BEGIN
clrscr ;
REPEAT
clrscr;
assign(tepchuyen,'e:\tre.pas');
reset(tepchuyen);
WHILE NOT eof(tepchuyen) DO
BEGIN
readln(tepchuyen,s);
writeln(s);
END;
writeln('0-> thoat');
writeln;
write('ten truyen ban muon doc vd: e:\nguoi nhen.pas ');
readln(z);
IF z='0' THEN break;
assign(vc,z);
reset(vc);
clrscr;
WHILE NOT eof(vc) DO
BEGIN
readln(vc,s);
writeln(s);
END;
writeln;
writeln('nhan enter khi da doc xong');
readln;
UNTIL z='0';
END;
'2':
BEGIN
clrscr;
write('ten truyen <=7 ki tu:');
readln(tenchuyen);
tenchuyen:='e:\truyen\'+ tenchuyen +'.pas';
assign(vcx,'e:\tre.pas');
append(vcx);
writeln(vcx,tenchuyen);
close(vcx);
clrscr;
i:=0;
assign(tuy,tenchuyen);
rewrite(tuy);
append(tuy);
writeln('viet "het" khi da ket thuc truyen');
REPEAT
i:=i+1;
write('cau thu',i,':');
readln(noi);
IF (noi='het') THEN break;
writeln(tuy,noi);
UNTIL noi='het';
writeln(tendang);
close(tuy);
END;

END;
END;
'2':
BEGIN
REPEAT
clrscr;
assign(cau,'e:\do.pas');
reset(cau);
WHILE NOT eof(cau) DO
BEGIN
readln(cau,s);
writeln(s);
END;
writeln;
writeln('1->dang cau do/tra loi 0-> thoat');
choncau:=readkey;
append(cau);
CASE choncau OF
'1':BEGIN
writeln('viet "het" khi da xong');
REPEAT
write('cau do:');
readln(caudo);
IF caudo='het' THEN break;
writeln(cau,tendang,':',caudo);
UNTIL noi='het';
END;
END;
close(cau);
UNTIL choncau='0';

END;
'3':BEGIN
clrscr;
writeln('bat dau danh dan...');
writeln(' a la do <------> j la si');
writeln('k la tat nhac');
writeln('l la thoat danh danh');
REPEAT
note:=readkey;
CASE note OF
'a':BEGIN nosound;sound(512); END;
's':BEGIN nosound; sound(572); END;
'd':BEGIN nosound; sound(645); END;
'f': BEGIN nosound;sound(683); END;
'g': BEGIN nosound;sound(767); END;
'h':BEGIN nosound; sound(861); END;
'j':BEGIN nosound; sound(967); END;
'k': nosound;
END;
UNTIL note='l';
nosound;
END;
'4':BEGIN
REPEAT
clrscr;
assign(tro,'e:\tro.pas');
reset(tro);
WHILE NOT eof(tro) DO
BEGIN
readln(tro,s);
writeln(s);
END;
writeln;
writeln('1-> dang tro cua ban 0-> thoat');
chontro:=readkey;
CASE chontro OF
'1':
BEGIN
clrscr;
append(tro);
writeln('viet "het" khi da viet xong tro nghich cua ban vao');
writeln;
REPEAT
write('tro nghich cua ban:');
readln(vcxz);
IF vcxz='het' THEN break;
writeln(tro,tendang,':',vcxz);
UNTIL noi='het';
close(tro);
END;

END;
UNTIL chontro='0';
END;
END;
UNTIL chontr='0';
END;
END;
UNTIL toi='0';
END;
{}
END;
'2':BEGIN

clrscr;
writeln('chao ban!');
writeln;
assign(tep1,'e:\dangki.pas');
append(tep1);
write('cho ho va ten cua ban:');
readln(u);
clrscr;
writeln;
write('nhap ngay thang nam sinh vd:2-11-1997 ');
readln(ngaysinh);
clrscr;
write('gioi tinh:');
readln(gioitinh);
clrscr;
write('ban hoc lop nao (ghi ro)vd:8B ');
readln(lop);
clrscr;
writeln;
write('ten dang nhap mong muon:');
readln(qwe);
clrscr;


BEGIN
clrscr;
writeln;
write('nhap mat khau:');
w:=14;
FOR e:=1 TO 255 DO
BEGIN
w:=w+1;
r[e]:=readkey;
gotoxy(w,wherey);
IF r[e]=#8 THEN
BEGIN
IF w<=15 THEN BEGIN clrscr;write('nhap mat khau:') END ELSE
BEGIN
w:=w-2;
gotoxy(w,wherey);
clrEol;
END;
END ELSE
IF r[e]=#13 THEN break;
IF r[e]=#8 THEN delete(t,length(t),1) ELSE t:=t+r[e];
write(#15);

END;
END;
IF (length(u)=0)OR(length(ngaysinh)=0)OR(length(qwe)=0)OR(length(t)=0) THEN
BEGIN
clrscr;
writeln('xin loi trong khi dang ki ban khong hop tac:');
IF length(u)=0 THEN writeln('- ban da khong nhap ten cua ban');
IF length(ngaysinh)=0 THEN writeln('- ban da khong nhap ngay sinh cua ban');
IF length(qwe)=0 THEN writeln('- ban khong nhap ten tai khoan');
IF length(t)=0 THEN writeln('- ban da khong nhap mat khau');
readln;
END ELSE
BEGIN

writeln;
clrscr;
writeln;
write('dang gui thu...');
delay(3000);
clrscr;
writeln;
writeln;
writeln('tai khoan cua ',u,' se duoc ki hoat vao buo^?i hoc. cua? ADMIN!xin cam on ban da dang ki!');
readln;
writeln(tep1);
writeln(tep1,'---------------------------------------------------------------------------------------');
writeln(tep1);
writeln(tep1,'lop:',lop);
writeln(tep1,'gioi tinh:',gioitinh);
writeln(tep1,'ho ten: ',u);
writeln(tep1,'ngay sinh: ',ngaysinh);
writeln(tep1,'ten dang nhap: ',qwe );
writeln(tep1,'mat khau: ',t);
close(tep1);
END;
END ELSE delete(t,1,length(t));
END;
UNTIL q='0';
END.
avatar
Administrator
Administrator
Administrator

Tổng số bài gửi : 44
Join date : 27/01/2012

Xem lý lịch thành viên http://thcstht.forumvi.com

Về Đầu Trang Go down

Xem chủ đề cũ hơn Xem chủ đề mới hơn Về Đầu Trang


 
Permissions in this forum:
Bạn không có quyền trả lời bài viết