This commit is contained in:
Oleksandr Vyshniakov 2025-09-23 23:10:42 +02:00
parent 4c6fdf2e05
commit 04bd891ea0

View File

@ -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;
}
}