Reply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> Pomozite Hitno!, Domaci

sladja92
post Dec 12 2007, 10:14 PM
Post #1





Group: Članovi
Joined: 30-July 07
From: KG
Member No.: 606
Status: Van MGa
Ime i prezime: Sladjana Nikolić
Škola/Razred: Prva kragujevačka gimnazija IIsm



Ljudi , Pomozite oko ovog zadatka:
Napisati program koji uneti broj u osnovi m1 prevodi u osnovu m2.
( Moze sa prevodjenjem u osnovu 10, a ne mora! )
Kod ispisati u Pascalu.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hannibal Lecter
post Dec 12 2007, 10:17 PM
Post #2





Group: Članovi
Joined: 15-October 06
From: People's Democratic Republic of Konjarnik
Member No.: 154
Status: Bivši učenik MGa
Ime i prezime: Ilija Ivanišević
Škola/Razred: Fizički fakultet, B smer, I godina,



E pogledacu sada imao sam to na kompu ali ne znam da li i dalje imam.
Ne znam ovako da resim


--------------------
And as we wind on down the road
Our shadows taller than our soul
There walks a lady we all know
Who shines white light and wants to show
How everything still turns to gold
And if you listen very hard
The truth will come to you at last
When all are one and one is all
To be a rock and not to roll


Svi me žele, a ja sam nedodirljiv!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hannibal Lecter
post Dec 12 2007, 10:26 PM
Post #3





Group: Članovi
Joined: 15-October 06
From: People's Democratic Republic of Konjarnik
Member No.: 154
Status: Bivši učenik MGa
Ime i prezime: Ilija Ivanišević
Škola/Razred: Fizički fakultet, B smer, I godina,



Ovo su ti funkcije za prevodjenje broja iz osnove N u decimalni zapis i obrnuto. Prvo broj osnove m1 prevedes u dec, pa iz dec u osnovu m2

CODE
function N2Dec(b:string;osn:integer):integer;
var
 a:integer;
 c:char;
 i, n: integer;
begin
 a:=0;
 for i:=1 to length(B) do
 begin
 c:=upcase(b[i]);
 if c<='9' then
   n:=ord©-ord('0')
 else
   n:=ord©-ord('A')+10;
 a:=a*osn+n;
 end;
 N2Dec:=a;
end;

function Dec2N(a,osn:integer):string;
var b:string;
   c:char;
   n:integer;
begin
 b:='';
 while a>0 do
 begin
   n:=a mod osn;
   if n<10 then c:=****n+ord('0'))
   else c:=****n+ord('A')-10);
   b:=c+b;
   a:=a div osn;
 end;
Dec2N:=b;
end;


--------------------
And as we wind on down the road
Our shadows taller than our soul
There walks a lady we all know
Who shines white light and wants to show
How everything still turns to gold
And if you listen very hard
The truth will come to you at last
When all are one and one is all
To be a rock and not to roll


Svi me žele, a ja sam nedodirljiv!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
sladja92
post Dec 13 2007, 03:47 PM
Post #4





Group: Članovi
Joined: 30-July 07
From: KG
Member No.: 606
Status: Van MGa
Ime i prezime: Sladjana Nikolić
Škola/Razred: Prva kragujevačka gimnazija IIsm



Hvala puno smile.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicTopic OptionsStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: