This commit is contained in:
Yaroslav Orlianskyi 2022-03-17 14:16:17 +01:00
parent 546ec33526
commit bf118bb4c7

View File

@ -1,8 +1,21 @@
#include <stdio.h>
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;
}