![]() |
|
|
#1 (permalink) | ||
|
Üye
![]() ![]() Üyelik tarihi: Mar 2008
Nerden: İstanBuL
Mesajlar: 62
Konular: 11
Üye No: 30392
Rep Gücü : 8
Rep Puanı : 149
Rep Seviyesi :
![]() ![]() |
unit Unit1;
interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, dxCntner, dxEditor, dxExEdtr, dxEdLib; type TForm1 = class(TForm) Button1: TButton; Label1: TLabel; Edit1: TEdit; procedure Button1Click(Sender: TObject); procedure Hesapla; private { Private declarations } girsay : Integer; modu : Integer; kalan : Integer; bolen : Integer; Sonuc : String; public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Hesapla; begin kalan := girsay mod bolen; modu := girsay div bolen; while modu > 0 do if bolen=1000 then begin Sonuc := Sonuc+'M'; dec(modu) //modu := modu-1; end else if bolen=900 then begin Sonuc := Sonuc+'CM'; dec(modu) end else if bolen=500 then begin Sonuc := Sonuc+'D'; dec(modu) end else if bolen=400 then begin Sonuc := Sonuc+'CD'; dec(modu) end else if bolen=100 then begin Sonuc := Sonuc+'C'; dec(modu) end else if bolen=90 then begin Sonuc := Sonuc+'XC'; dec(modu) end else if bolen=50 then begin Sonuc := Sonuc+'L'; dec(modu) end else if bolen=40 then begin Sonuc := Sonuc+'XL'; dec(modu) end else if bolen=10 then begin Sonuc := Sonuc+'X'; dec(modu) end else if bolen=9 then begin Sonuc := Sonuc+'IX'; dec(modu) end else if bolen=5 then begin Sonuc := Sonuc+'V'; dec(modu) end else if bolen=4 then begin Sonuc := Sonuc+'IV'; dec(modu) end else if bolen=1 then begin Sonuc := Sonuc+'I'; dec(modu) end; case bolen of 1 : bolen := 0; 4 : bolen := 1; 5 : bolen := 4; 9 : bolen := 5; 10 : bolen := 9; 40 : bolen := 10; 50 : bolen := 40; 90 : bolen := 50; 100 : bolen := 90; 400 : bolen := 100; 500 : bolen := 400; 900 : bolen := 500; 1000: bolen := 900; end; girsay := kalan; end; procedure TForm1.Button1Click(Sender: TObject); begin Sonuc := ''; bolen := 1000; girsay :=StrToInt(Trim(Edit1.Text)); while bolen > 0 do Hesapla; Label1.Caption :=Sonuc; Edit1.SetFocus; end; end.;
__________________
http://img233.imageshack.us/img233/4061/meetankpf5.jpg |
||
|
|
|
![]() |
| Bu konunun kısa yolunu aşağıdaki sitelere ekleyebilirsiniz! |
| Konu Araçları | |
| Stil | |
|
|
Benzer Konular
|
||||
| Konu | Konuyu Başlatan | Forum | Cevaplar | son Mesaj |
| 7 Rakamı Heryerde Karşımızda | Luiz | Garip olaylar | 2 | 25-06-2008 19:44 |
| Roma Rakamları | WaMPiR_CaDı | Matematik | 0 | 29-02-2008 19:02 |
| Roma Tiyatrosu | WaMPiR_CaDı | Kültür | 0 | 29-02-2008 15:14 |
| AS Roma - Galatasaray (Fight) | Rockforev3R | Galatasaray | 2 | 24-02-2008 18:11 |
| Eskiden 13 rakamı uğursuzdu!!! Şimdi 23 rakamı hakkında okuyacağınız tesadüfler | emay | Off Topic | 2 | 08-02-2008 17:02 |