تحويل الأرقام الى أرقام رومانية
#1
السلام عليكم جميعا وكيف حالكم

كنت احاول مع برنامج تحويل الأرقام من رقم عادي الى أرقام رومانية (حروف) او رموز

بحثت في الانترنيت وجدت هذا الرموز وكل شئ صحيح والتنفيذ :mad:

كود :
[align=left] program conversion; . var nb:intger; {nombre decimal} I,V,X,L,C,D,M:char; a,b,f:char; n:integer; j,g,h,t,w,e,o,p,q,r,s:integer procedure convers(n:integer;a,b,f:char); begin case n of l:write(a); 2:write(a,a); 3:write(a,a,a); 4:write(a,b); 5:write (b); 6:write(b,a); 7:wriLe(b,a,a); 8:write{b,a,a,a); 9:write{a,f); end; end; procedure unite(nb:integer); var a,b, f:char; begin a: =’I’ ; b: =’V’ ; f: =’X’; convers(nb,a,b,f); end; procedure dizaine(nb:integer); var a,b,f:char; begin a:='X'; b:='L'; f :='C'; convers(nb,a,b,f); end; procedure centaine(nb:integer); var a,b,f:char; begin a:='C'; b:='D'; f:='M' ; convers(nb,a,b,f); end; procedure mille(nb:integer); var a:char; begin a: ='M' ; convers(nb,a,b,f); end; begin writeln('Entrez le nombre entier a convertir'); read (nb); if O>nb then writeln('l operation est impossible'); if 4000<=nb then writeln('l operation est impossible'); if (l<-nb) and (nb<10) then unite(nb) else if(l0<=nb)and(nb<100) then begin dizaine(nb); unite (nb) ; end ; else if (100<=nb) and (nb<1000) then begin r:=nb div 100; r:=centaine(nb); g:=:nb mod 100; s:=g div 10 ; g:= dizaine(nb); q:=s mod 10; q:=unite(nb); end else if (lOOO<=nb)and(nb<3999) then begin e:=nb div 1000; e:= mille (nb) ; h:=nb mod 1000; n:= h div 100; n:= centaine(nb); j:=h mod 100; t:=j div 10; t:= dizaine(nb) ; w:=j mod 10; w:= unite(nb); end; end. [/align]

انتظر رايكم وتصحيح الأخطاء
والسلام عليكم
الرد


الردود في هذا الموضوع
تحويل الأرقام الى أرقام رومانية - بواسطة xhunter - 02-04-2009, 10:19 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم