From 04bd891ea0ed80dc1ece51950c2e6e08024b5724 Mon Sep 17 00:00:00 2001 From: ov075wu Date: Tue, 23 Sep 2025 23:10:42 +0200 Subject: [PATCH] refresh\ --- program.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/program.c b/program.c index 79a1160..53a2c8b 100644 --- a/program.c +++ b/program.c @@ -1,6 +1,25 @@ #include +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; -} \ No newline at end of file +} +