From 3c8964523f3ea42963c88a23940e7667ab711a07 Mon Sep 17 00:00:00 2001 From: Vladyslav Korzun Date: Mon, 6 Mar 2023 17:35:40 +0000 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BB(=D0=B0)=20?= =?UTF-8?q?'du4/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du4/program.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 du4/program.c diff --git a/du4/program.c b/du4/program.c new file mode 100644 index 0000000..97f1d46 --- /dev/null +++ b/du4/program.c @@ -0,0 +1,19 @@ +#include +#include +#include +int main(){ +float value = 0; +char znaky[13] = "1.1 2.2 3.3"; +char* koniec_pola = znaky + strlen(znaky); +char* koniec_cisla = NULL; +char* zaciatok_cisla = znaky; +while (zaciatok_cisla < koniec_pola){ + value = strtof(zaciatok_cisla,&koniec_cisla); + if (value == 0){ + break; + } + printf("Nasiel som cislo %f\n",value); + zaciatok_cisla = koniec_cisla + 1; +} +return 0; +}