Iskompajlira ga savrseno, ali kada pokrenem program on pukne i pojavi mi se onaj prozor send/don't send report to microsoft...
Ubacio sam kod i u dev-c++ i code:blocks (oba su MingW32), isto se desava...
da li bi trebalo nesto da dodam...
Code:
#include <stdio.h>
#include <stdlib.h>
struct cvor{
int a;
int b;
struct cvor *l;
struct cvor *d;
};
struct cvor* ubaci(struct cvor *koren, int j){
struct cvor *t, *p, *pom;
int k = 0;
t = koren;
p = NULL;
while((t) && (!k)){
p = t;
if (j < t->a) t = t->l;
else if (j > t->a) t = t->d;
else k = 1;
};
if (k = 1){
t->b++;
return koren;
};
pom = (struct cvor*)malloc(sizeof(struct cvor));
pom->a = j;
pom->b = 1;
if (!p) return pom;
if (j < p->a) p->l = pom;
else p->d = pom;
return koren;
};
int main(int argc, char *argv[]){
struct cvor *t = NULL;
t = ubaci(t, 1);
printf("%d\n", t->a);
system("PAUSE");
return 0;
}
#include <stdio.h>
#include <stdlib.h>
struct cvor{
int a;
int b;
struct cvor *l;
struct cvor *d;
};
struct cvor* ubaci(struct cvor *koren, int j){
struct cvor *t, *p, *pom;
int k = 0;
t = koren;
p = NULL;
while((t) && (!k)){
p = t;
if (j < t->a) t = t->l;
else if (j > t->a) t = t->d;
else k = 1;
};
if (k = 1){
t->b++;
return koren;
};
pom = (struct cvor*)malloc(sizeof(struct cvor));
pom->a = j;
pom->b = 1;
if (!p) return pom;
if (j < p->a) p->l = pom;
else p->d = pom;
return koren;
};
int main(int argc, char *argv[]){
struct cvor *t = NULL;
t = ubaci(t, 1);
printf("%d\n", t->a);
system("PAUSE");
return 0;
}
please help!!!
All it takes is one bad day to reduce the sanest man alive to lunacy!
That's how far the world is from where I am: Just one bad day...
That's how far the world is from where I am: Just one bad day...