diff --git a/du3/program.c b/du3/program.c index 2d24fc2..4418d70 100644 --- a/du3/program.c +++ b/du3/program.c @@ -1,8 +1,21 @@ #include int main(){ + int c,a = 0; + int s; + int result; + int vxod[99]; for(int i = 0; i < 10; i++){ - printf("%d\n", i); + c = getchar(); + if(c != 1) + break; + vxod[i] = c; + a++; } + s = vxod[0]; + for(int i = 0; i < a; i++){ + result = s * vxod[i] + i; + } + printf("Vysledok je: %d\n", result); return 0; }