From 88df510aacba29a323bbd876cbb856154cfa9f0c Mon Sep 17 00:00:00 2001 From: Bohdan Yanchyk Date: Sun, 15 Mar 2020 18:12:20 +0000 Subject: [PATCH] =?UTF-8?q?Aktualizovat=20=E2=80=9Ea1/program.c=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a1/program.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/a1/program.c b/a1/program.c index 1b1d3e6..b4b9774 100644 --- a/a1/program.c +++ b/a1/program.c @@ -7,12 +7,14 @@ int main() long double value =0; int count =0; long double arr[50]={0}; + scanf("%lf",&x); + if(isalpha(x)!=0){ + printf("Nepodarilo sa nacitat x\n"); + return 0; + } while(scanf("%Lf",&value)!=EOF){ - if(isdigit(value)==0){ - printf("Nepodarilo sa nacitat x\n"); - return 0; - } + arr[count]=value; count++; }