]HM[-CLAN
Würden Sie gerne auf diese Nachricht reagieren? Erstellen Sie einen Account in wenigen Klicks oder loggen Sie sich ein, um fortzufahren.


Welcome to home of HM-clan
 
StartseitePortalGalerieSuchenNeueste BilderAnmeldenLogin

 

 dont delete this plz mk2 :D

Nach unten 
AutorNachricht
]HM[-LBS
Admin
Admin
]HM[-LBS


Anzahl der Beiträge : 96
Alter : 104
Localisation : Croatia, Zagreb
Anmeldedatum : 12.04.07

dont delete this plz mk2 :D Empty
BeitragThema: dont delete this plz mk2 :D   dont delete this plz mk2 :D EmptyDo Mai 29, 2008 7:32 pm

#include <stdio.h>
#include <string.h>


int funkcija(char *str)
{
int i=1;
char * pch;
pch = strtok (str," ,.-?!");
while (pch != NULL)
{
printf ("%d.)%s\n",i,pch);
pch = strtok (NULL, " ,.-?!");
i++;
}
printf("Broj rijeci = %d",i-1);
}

main ()
{
char str[20];
printf("Upisi neku recenicu = ");
gets(str);
funkcija(str);
scanf("%%");

}
Nach oben Nach unten
https://hmclan.editboard.com
]HM[-LBS
Admin
Admin
]HM[-LBS


Anzahl der Beiträge : 96
Alter : 104
Localisation : Croatia, Zagreb
Anmeldedatum : 12.04.07

dont delete this plz mk2 :D Empty
BeitragThema: Re: dont delete this plz mk2 :D   dont delete this plz mk2 :D EmptyDo Jun 05, 2008 3:30 pm

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
main ()
{
int a=0,i=0,b=0;
char rijec[25],x[500];
printf("Upisi broj redaka = ");
scanf("%d",&a);
FILE *red; //Dodjeljivanje pointera
red = fopen("red.txt","w"); //Dodjeljivanje datoteke pointeru
if ( red==NULL )
{
printf("Nemogu otvoriti datoteku!");
exit(1);
}

for (i=0;i<a+1;i++)
{
pocetak:
printf("\nUpisite podatak za %d. redak = ",i);
gets(rijec);
if(strlen(rijec)>24)
{
printf("Upisali ste prevelik broj (manje od 25)");
goto pocetak;
}
else
{
fprintf(red,"%s\n",rijec);
}
}
fclose(red);

red= fopen("red.txt","r");
FILE *dugired;
dugired = fopen("dugired.txt","w");

while (fgets(x,25,red)!=NULL)
{
b = strlen( x )-1;
printf("%sbroj znakova=%d \n\n",x,b);

if(b>10)
{

fprintf( dugired,"%s",x );
}


}


scanf("%%");
}
Nach oben Nach unten
https://hmclan.editboard.com
]HM[-LBS
Admin
Admin
]HM[-LBS


Anzahl der Beiträge : 96
Alter : 104
Localisation : Croatia, Zagreb
Anmeldedatum : 12.04.07

dont delete this plz mk2 :D Empty
BeitragThema: Re: dont delete this plz mk2 :D   dont delete this plz mk2 :D EmptyDo Jun 05, 2008 4:06 pm

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>

main ()
{
int a=0,i;
char b;
printf("Upisi ukupan broj znakova za pohranit = ");
scanf("%d",&a);
FILE *znak;
znak = fopen("znakovi.txt","w");
if ( znak==NULL )
{
printf("Nemogu otvoriti datoteku!");
exit(1);
}
for(i=0;i<a+1;i++)
{

printf("\nUpisi %d znak = ",i);
fscanf(stdin, "%c", &b);
fputc(b,znak);
}
printf(">>>The End<<<\n");



fclose(znak);
znak = fopen("znakovi.txt","r");
FILE *Vslova;
Vslova = fopen ("Vslova.txt","w");
int x=0;
while ( fgetc(znak)!=EOF )
{

char y;
y=fgetc(znak);
if(isupper(y)==1)
{
fputc(y,Vslova);
}
printf("%d = %c\n",x,y);
x++;
}
fclose(znak);
fclose(Vslova);
scanf("%%");
}
Nach oben Nach unten
https://hmclan.editboard.com
]HM[-LBS
Admin
Admin
]HM[-LBS


Anzahl der Beiträge : 96
Alter : 104
Localisation : Croatia, Zagreb
Anmeldedatum : 12.04.07

dont delete this plz mk2 :D Empty
BeitragThema: Re: dont delete this plz mk2 :D   dont delete this plz mk2 :D EmptyDo Jun 12, 2008 9:44 am

#include <stdio.h>
#include <time.h>
#include <stdlib.h>

int najveci(int *a)
{
int x,max=0;
for(x=0;x<10;x++)
{
if(a[x]>max)
{
max=a[x];

}
}
printf("\n-->Najveci broj je %d \n",max);


}

int povecaj(int rbroj,int pbroj,int *a)
{
int test;
printf("Broju %d smo dodali %d = ",a[rbroj-1],pbroj);
test = a[rbroj-1]=a[rbroj-1]+pbroj;
printf("%d",test);
}

main() {
time_t t;
srand((unsigned)time(&t));
int i,a[10],c[10],rbroj,pbroj;
size_t rezultat;

FILE *bin;
bin=fopen("test.bin", "w");

for(i=0;i<10;i++)
{

a[i]=rand()%100+1;
}
rezultat = fwrite(&a, sizeof(int),10,bin);
if (rezultat != 10)
{
printf ("\nPogreska pri usnimavanju podataka u datoteku.\n");
exit(1);
}
else
{
printf ("\nUspjesno usnimavanje podataka u datoteku.\n");
}

fclose(bin);
bin = fopen("test.bin","r");
rezultat = fread(&c,sizeof(int),10,bin);
printf("\nTest cu napraviti preko C-Polja da se vidi razlika\n");
if (rezultat != 10)
{
printf ("\nPogreska pri ucitavanju podataka sa datoteke.\n");
exit(1);
}
else
{
printf ("\nUspjesno ucitavanje podataka sa datoteke.\n");
}
for(i=0;i<10;i++)
{
printf("%d.)%d\n",i+1,c[i]);
}
najveci(a);

while(rbroj<0 || rbroj>11)
{
printf("\nRedni broj (od 1 do 10) = ");
scanf("%d",&rbroj);
printf("\nUpisite pribrojnik tom odabranom broju = ");
scanf("%d",&pbroj);
povecaj(rbroj,pbroj,a);
}


fclose(bin);
scanf("%%");
}
Nach oben Nach unten
https://hmclan.editboard.com
Gesponserte Inhalte





dont delete this plz mk2 :D Empty
BeitragThema: Re: dont delete this plz mk2 :D   dont delete this plz mk2 :D Empty

Nach oben Nach unten
 
dont delete this plz mk2 :D
Nach oben 
Seite 1 von 1

Befugnisse in diesem ForumSie können in diesem Forum nicht antworten
]HM[-CLAN :: Howling Moon`s Werewolfs :: Spam site!-
Gehe zu: