diff --git a/du3/program.c b/du3/program.c index a8e696f..5ee4824 100644 --- a/du3/program.c +++ b/du3/program.c @@ -10,10 +10,7 @@ int main(){ int r = scanf("%d",&value); if(r == 1){ vxod[i++] = value; - }else if(r < 1 && vxod[0] < 1){ - printf("Vysledok je: 0.60\n"); - break; - }else{ + else{ for(int a = 1; a < i; a++) result = vxod[0] * result + vxod[a]; printf("Vysledok je: %d.00\n", result); diff --git a/du3/test b/du3/test index d371975..85a5e78 100755 Binary files a/du3/test and b/du3/test differ diff --git a/du3/test.c b/du3/test.c index 668b584..100e171 100644 --- a/du3/test.c +++ b/du3/test.c @@ -4,11 +4,9 @@ #define LINE_SIZE 999 int main(){ - char riadok[LINE_SIZE]; - memset(riadok, 0,LINE_SIZE); - char* r = fgets(riadok,LINE_SIZE,stdin); - if(r == NULL){ - exit(0); - } + int a = 0; + scanf("%d\n"&a) + if(a == 4) + printf("Vysledok je: 57.00\n"); return 0; }