thu nhat dung co trach tui danh khong dau vi cai may nay khung lam, danh font vni len ma nhin thay cai gi dau khong ha. khong tin thi qua coi cai bai phat hien moi ve tac cua tui thi biet
noi dong dai du roi coi thu cai code nay cua ngon ngu nao nha
Program Doi_thap_phan_ra_nhi_phan; Var He10,N,Y:Word; He2,Tam:String; Begin Writeln('DOI SO TU HE THAP PHAN SANG HE NHI PHAN'); Writeln(' -----------------'); Writeln; Write('-Nhap so nguyen he thap phan: '); Readln(He10); N:=He10; He2:=' '; Repeat Y:=He10 Mod 2; Str(Y, Tam); He2:=Tam + He2; He10:= He10 Div 2; Until He10 = 0; Writeln; Writeln('+So he 10 la : ',N); Writeln('+Doi sang he 2 la: ',He2); Writeln; Writeln(' Bam phim <Enter> de ket thuc'); Readln End.
hệ thập lục Program Doi_he_16; Const KyTuHe16:array[0..$F] Of Char ='0123456789ABCDEF'; Var SoWord:Word; SoHex:String[4]; Begin Writeln('DOI SO NGUYEN KIEU WORD RA HE THAP LUC'); Writeln('--------------------------------------'); Writeln; Write('-Nhap so kieu Word: '); Readln(SoWord); SoHex[0]:=#4; SoHex[1]:= KyTuHe16[Hi(SoWord) SHR 4]; SoHex[2]:= KyTuHe16[Hi(SoWord) AND $F]; SoHex[3]:= KyTuHe16[Lo(SoWord) SHR 4]; SoHex[4]:= KyTuHe16[Lo(SoWord) AND $F]; Writeln('+So nguyen kieu Word = ',soWord); Writeln('+Doi ra so he thap luc = $',SoHex); Writeln; Writeln(' Bam phim <Enter> de ket thuc '); Readln End.
Program Doi_thap_phan_ra_he_bat_ky; Var He10,N,Y,HeN:Word; He,Tam:String; Begin Writeln('DOI SO TU HE THAP PHAN SANG HE BAT KY'); Writeln(' -----------------'); Writeln; Write('-Nhap so nguyen he thap phan: '); Readln(He10); N:=He10; Write('-Doi sang he nao: '); Readln(HeN); He:=' '; Repeat Y:=He10 Mod HeN; If Y < 10 Then Str(Y, Tam) Else Tam:=Chr(Y+55); He:=Tam + He; He10:= He10 Div HeN; Until He10 = 0; Writeln; Writeln('+So he 10 la : ',N); Writeln('+Doi sang he: ',HeN:2,' la: ',He); Writeln; Writeln(' Bam phim <Enter> de ket thuc'); Readln End.
Program Doi_thap_phan_ra_thap_luc; Var He10,N,Y:Word; He16,Tam:String; Begin Writeln('DOI SO TU HE THAP PHAN SANG HE THAP LUC PHAN'); Writeln(' -----------------'); Writeln; Write('-Nhap so nguyen he thap phan: '); Readln(He10); N:=He10; He16:=' '; Repeat Y:=He10 Mod 16; If Y < 10 Then Str(Y, Tam) Else Tam:=Chr(Y+55); He16:=Tam + He16; He10:= He10 Div 16; Until He10 = 0; Writeln; Writeln('+So he 10 la : ',N); Writeln('+Doi sang he 16 la: ',He16); Writeln; Writeln(' Bam phim de ket thuc'); Readln End.
Program Doi_he_2; Const KyTuHe2:array[0..1] Of Char ='01'; Var SoWord:Word; SoBinary:String[16]; i:byte; Begin Writeln('DOI SO NGUYEN KIEU WORD RA HE NHI PHAN'); Writeln('--------------------------------------'); Writeln; Write('-Nhap so kieu Word: '); Readln(SoWord); SoBinary[0]:=#16; For i:=15 DownTo 0 Do If (SoWord AND (1 SHL i)) = (1 SHL i) Then SoBinary[16-i]:= KyTuHe2[1] Else SoBinary[16-i]:= KyTuHe2[0]; Writeln('+So nguyen kieu Word = ',soWord); Writeln('+Doi ra so he nhi phan= B ',SoBinary); Writeln; Writeln(' Bam phim <Enter> de ket thuc '); Readln End.
coi free khoi ton tien
--------------------
Nhóm bạn bè:
Thành viên này chưa có người bạn nào trong mạng VnVista, nếu bạn muốn trở thành người bạn đầu tiên của thành viên này, hãy click vào đây
--------------------
|