From 811dc69e285fae04545ecf889e79364c5961dafb Mon Sep 17 00:00:00 2001 From: Andrii Hermaniuk Date: Fri, 18 Mar 2022 14:49:59 +0100 Subject: [PATCH] aaaa --- du3/program.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/du3/program.c b/du3/program.c index 08c192b..14a307a 100644 --- a/du3/program.c +++ b/du3/program.c @@ -11,13 +11,16 @@ int main(){ for(int idx=0;1;idx++ ){ ch=getchar(); if(ch==EOF||ch==' ')break; - if((ch<='9'&&ch>='0')||(ch=='.')||(ch==EOF)||(ch==' ')||(ch=='\n')); - else { - printf("Nepodarilo sa nacitat polynom na 2 mieste.\n"); - return 0; - } pol[idx]=ch; } + for(int i=0, p=0;i='0')||(pol[i]=='.')||(pol[i]==EOF)||(pol[i]==' ')); + else { + printf("Nepodarilo sa nacitat polynom na 2 mieste.\n"); + return 0; + } + } int koef=-1; for(int i=0;i