refresh\
This commit is contained in:
parent
4c6fdf2e05
commit
04bd891ea0
23
program.c
23
program.c
@ -1,6 +1,25 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int najti (char* pole, int size, char znak) {
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (pole[i] < size) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int main() {
|
||||
printf("Hello world!");
|
||||
char text[] = "Zdarova Oleksandr!";
|
||||
char hochunajti = 's';
|
||||
int pozition = najti(text, sizeof(text), hochunajti);
|
||||
|
||||
if (pozition != -1) {
|
||||
printf("Znak '%c' na %d", hochunajti, pozition);
|
||||
} else {
|
||||
printf("nebyla najdena poshol nahui");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user