[ Outline ] · Standard · Linear+

> Pomoc Oko Nula U Nizu [Pascal], pomagaj

Magdalina_kg
post Feb 26 2008, 03:04 PM
Post #1





Group: Članovi
Joined: 20-October 07
Member No.: 717
Status: Van MGa
Ime i prezime: Magdalina Čivović
Škola/Razred: Obdareni u matematičkoj gimnaziji-Prva kragujevačka gimnazija



pomagajte na bloku sam
kako da smanjim niz ako imam vise nula da skratim na jednu
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topicStart Poll
Replies
maxydelanoche
post Feb 26 2008, 03:43 PM
Post #2





Group: Članovi
Joined: 3-May 06
From: Zion
Member No.: 61
Status: Van MGa



XD.gif Da li je vec prosao blok? Nisi rekla u kom jeziku? Valjda sam dobro skontala zadatak. a je niz, n broj clanova, i brojac. Evo u ce tarabi:

CODE
for (int i=0; i<n-1; i++)
if (a[i]==0 && a[i+1]==0)
obrisi(a, i, ref n);


a tamo negde napises metodicu

CODE
void obrisi(int[] a, int index, ref int n)
{
    for (int i=index; i<n-1; i++)
         a[i]=a[i+1];
    n--;
}


Nisam testirala ovo, ali to je to... Doduse, verovatnije mi deluje da radis u Pascalu ili Delphiju XD.gif ...

CODE
var
a: array of Integer;
i, j, n: integer;

begin
{uneses a i n}
for i:=0 to n-2
begin
    if a[i]=0 and a[i+1]=0 then
    begin
         for j:=0 to n-2
             a[i]=a[i+1];
         n:=n-1;
    end
end
end


A ne da sam davno radila u ovome neeego...
Ako hoces mogu ovo isto da napisem i u VB-u, Java#-u, c++-u... XD.gif

This post has been edited by maxydelanoche: Feb 26 2008, 03:44 PM


--------------------
Mi znamo sta se desava sa ljudima koji zastanu nasred puta. Bivaju pregazeni.
Nista nije nemoguce. Za nemoguce je samo potrebno malo vise vremena.

I'm doing the best I ever did, I'm doing the best that I can.

www.viva-fizika.org
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic
Magdalina_kg   Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 03:04 PM
Neonkitza   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 03:42 PM
maxydelanoche   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 03:43 PM
Magdalina_kg   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 03:52 PM
maxydelanoche   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 03:59 PM
Magdalina_kg   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 04:40 PM
Magdalina_kg   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 04:43 PM
maxydelanoche   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 05:42 PM
maxydelanoche   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 06:38 PM
Slovenatz   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 06:41 PM
NeverMore21   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 07:43 PM
maxydelanoche   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 07:49 PM
NeverMore21   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 08:36 PM
maxydelanoche   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 09:36 PM
NeverMore21   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 10:30 PM
maxydelanoche   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 10:40 PM
VIP <3   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 11:17 PM
maxydelanoche   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 26 2008, 11:38 PM
NeverMore21   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 27 2008, 01:47 PM
maxydelanoche   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 27 2008, 03:08 PM
VIP <3   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 28 2008, 12:41 PM
maxydelanoche   RE: Pomoc Oko Nula U Nizu [Pascal]   Feb 28 2008, 05:05 PM


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