From 7e5c02ceb39442b5eda86cd9c85c5a783cf342bb Mon Sep 17 00:00:00 2001 From: Vladyslav Korzun Date: Thu, 23 Mar 2023 18:24:10 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'a1/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a1/program.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/a1/program.c b/a1/program.c index 000ac4b..ff49043 100644 --- a/a1/program.c +++ b/a1/program.c @@ -18,13 +18,24 @@ int main() { int counter = 0; int che = 0; int count = 0; + int toc = 0; while ((r = fgets(znaky, LINE_SIZE, stdin)) != NULL) { if (feof(stdin)) { break; } if(znaky[0] == '\n'){ break; - } + } + for(int i = 0; i < 10; i++){ + if(znaky[i] == '.'){ + toc++; + } + } + //printf("-->%d\n", toc); + if(toc != 2){ + che = 1; + toc = 0; + } zaciatok_cisla = znaky; counter = 0; while (*zaciatok_cisla != '\0') {