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