Professional Documents
Culture Documents
Кумановски дијалект
Кумановски дијалект
. .
.
: (.) , (,),
(!) (?).
.
:
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#define MAX 1000
#define MEMCHECK(x) if(x==NULL) { printf("Nema memorija!\n"); exit(-1); }
hashmap_node info;
struct element *link;
} h_node; // Definiranje na element vo linearna lista (koficka) vo hash mapa
h_node *tmp;
h_node *p;
int h;
h=hash(key, tptr);
p=(h_node *) malloc(sizeof(h_node)); // alokacija za noviot jazel
(p->info).value=val;
(p->info).key=key;
{
h_node *p, *last;
int h;
h=hash(key,tptr);
for (p=tptr->buckets[h]; p!=NULL; p=p->link) {
if (!strcmp((p->info).key, key))
break;
}
if (p==NULL) return; // ako nema takvi jazli za brisenje
int main()
{
hashmap *hashTabela=(hashmap *)malloc(sizeof(hashmap));
int N,i;
scanf("%d",&N);
//sami odredete ja goleminata na hashTabelata
make_hash_map(hashTabela,N);
char zborKu[100][30],zborMk[100][30];
int j=0;
for(i=0; i<N; i++)
{
scanf("%s %s",zborKu[i],zborMk[i]);
insert(zborKu[i],zborMk[i],hashTabela);
j++;
}
char tekst[1000];
char c ;
scanf("%c",&c);
i=0;
while(1)
{
tekst[i]=c;
scanf("%c",&c);
i++;
if(c=='\n')
break;
}
tekst[i]='\0';
i=1;
int s=0;
while(tekst[i]!='\0')
{
char zborce[20];
s=0;
zborce[s]='\0';
while(tekst[i]!=' '&&tekst[i]!='!' && tekst[i]!='?' && tekst[i]!='.' && tekst[i]!=',')
{
zborce[s]=tekst[i];
i++;
s++;
}
zborce[s]='\0';
int tmp=0;
if(isupper(zborce[0]))
{
zborce[0]=tolower(zborce[0]);
tmp=1;
}
h_node *pom;
pom=search(zborce,hashTabela);
char pomosna[20];
if(pom==NULL)
{
if(tmp==1)
{
zborce[0]=toupper(zborce[0]);
}
printf("%s",zborce);
}
else
{
strcpy(pomosna,pom->info.value);
if(tmp==1)
{
pomosna[0]=toupper(pomosna[0]);
}
printf("%s",pomosna);
}
tmp=0;
while((tekst[i]==' ')||(tekst[i]==',')||(tekst[i]=='.')||(tekst[i]=='!')||(tekst[i]=='?'))
{
printf("%c",tekst[i]);
i++;
}
}
}
return 0;
}
- C 2 (0 / 2)
.
.
,
, ,
(postoi nepostoi).
/24, 8
. ,
, ,
. 10.10.10.0,
(10.10.10.110.10.10.254). , IP
, IP
. .
IP
.
:
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#define MAX 1000
#define MEMCHECK(x) if(x==NULL) { printf("Nema memorija!\n"); exit(-1); }
h=hash(key, tptr);
hashmap_node *pom = (hashmap_node *) malloc(sizeof(hashmap_node));
pom->value = val;
pom->key=key;
p=(h_node *) malloc(sizeof(h_node)); // alokacija za noviot jazel
p->info=pom;
p->link=NULL;
tmp=tptr->buckets[h];
h=hash(key,tptr);
//h_node pom = tptr->buckets[h];
for (p=tptr->buckets[h]; p!=NULL; p=p->link)
{
if (!strcmp((p->info)->key, key))
break;
}
if (p==NULL) return; // ako nema takvi jazli za brisenje
tptr->buckets[h]=p->link;
else
{
// naoganje na prethodnikot na jazelot sto treba da se izbrise
for (last=tptr->buckets[h]; (last!=NULL)&&(last->link!=NULL); last=last->link)
{
if (last->link==p)
break;
}
last->link=p->link;
}
{
if(tptr->buckets[i]!=NULL){
printf("%d:",i);
for(p=tptr->buckets[i]; p!=NULL; p=p->link)
print_h_node(p);
printf("\n");
}
}
}
int main()
{
hashmap *hashTabela=(hashmap *)malloc(sizeof(hashmap));
int N,i,M;
scanf("%d",&N);
make_hash_map(hashTabela,10);
//printf("%d\n",N);
char interfejs[N][100];
char routingtable[N][100];
//print_hashmap(hashTabela);
int h;
insert(interfejs[i],routingtable[i],hashTabela);
char ip_adresa_interfejs[40][100];
char ip_adresa_host[40][100];
i=0;
int j,k;
scanf("%d",&M);
for(i=0;i<M;i++){
scanf("%s", ip_adresa_interfejs[i]);
scanf("%s", ip_adresa_host[i]);
}
for(i=0;i<M;i++)
{
h_node *interfejs=search(ip_adresa_interfejs[i],hashTabela);
if(interfejs==NULL)
{
printf("ne postoi\n");
}
else
{
int flag=0;
while(interfejs!=NULL)
{
char pomosna[1000];
strcpy(pomosna,interfejs->info->value);
int j=0;
flag=0;
while(pomosna[j]!='\0')
{
int k=0, brojac=0;
char pom[20];
while(brojac!=3)
{
pom[k]=pomosna[j];
if(pomosna[j]=='.')
{
brojac++;
}
k++;
j++;
}
pom[k]='\0';
while((pomosna[j]!=',')&&(pomosna[j]!='\n')&&(pomosna[j]!='\0'))
{
j++;
}
flag=daliIsti(pom,ip_adresa_host[i]);
if(flag==1)
{
printf("postoi\n");
break;
}
if(pomosna[j]=='\0')break;
j++;
}
if(flag)
break;
interfejs=interfejs->link;
}
if(flag==0)
{
printf("ne postoi\n");
}
}
return 0;
}