gedhd
-
void druha()
-
{
-
int c;
-
FILE *fr, *fw;
-
-
if ((fr = fopen("program.txt","r")) == NULL)
-
printf("Nepodarilo sa otvorit subor na citanie.\n");
-
-
if ((fw = fopen("program_bk.txt","w")) == NULL)
-
printf("Nepodarilo sa otvorit subor na zapis.\n");
-
-
while ((c = getc(fr)) != EOF) {
-
if (c == '{')
-
do {
-
c = getc(fr);
-
} while(c != '}');
-
-
else
-
putc(c, fw);
-
}
-
-
if (fclose(fr) == EOF)
-
printf("Subor na citanie sa nepodarilo zatvorit.\n");
-
-
if (fclose(fw) == EOF)
-
printf("Subor na zapis sa nepodarilo zatvorit.\n");
-
-
}
-
-
void stvrta()
-
{
-
scanf("%c", &p[i][j]);
-
printf("%c", p[i][j]);
-
-
scanf("%c", p + i*N + j);
-
printf("%c", **(p + i*N + j));
-
-
}
-
-
int piata(int rozmer, int matica[rozmer][rozmer])
-
{
-
int sucet = 0, i, j;
-
-
/*naplnenie matice
-
for (i = 0 ; i < rozmer ; i++)
-
for ( j = 0 ; j < rozmer ; j++)
-
matica[i][j] = i*rozmer + j;
-
*/
-
-
for (i = 0 ; i < rozmer ; i++)
-
for (j = 0 ; j < rozmer ; j++)
-
if (i >= j)
-
sucet += matica[i][j];
-
-
return sucet;
-
}
-
-
int siesta(char *s)
-
{
-
int pocet = 0, pred = ' ', i;
-
-
for (i = 0 ; i < strlen(s) ; i++) {
-
if ((pred == ' ' || pred == '\t') && s[i] != ' ' && s[i] != '\t')
-
pocet++;
-
pred = s[i];
-
}
-
-
return pocet;
-
}
-
-
int siedma(unsigned x, unsigned y, unsigned i)
-
{
-
if ((i<sizeof(x)*8) && (i<sizeof(y)*8)) {
-
if (((x >> (i-1)) & 1) == ((y >> (i-1)) & 1))
-
return printf("1\n");
-
else
-
return printf("0\n");;
-
}
-
-
-
}