Изменил(а) на 'du3/program.c'
This commit is contained in:
parent
63b0c4ec5a
commit
6ff44af0d7
@ -1,24 +1,25 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
|
int c;
|
||||||
int vxod[999];
|
int vxod[999];
|
||||||
int i = 0;
|
for(int i = 0; i < 2; i++){
|
||||||
int result = 0;
|
scanf("%d", &c);
|
||||||
while(1){
|
if(c == 4)
|
||||||
int value = 0;
|
|
||||||
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;
|
break;
|
||||||
}else{
|
vxod[i] = c;
|
||||||
for(int a = 1; a < i; a++)
|
|
||||||
result = vxod[0] * result + vxod[a];
|
|
||||||
printf("Vysledok je: %d.00\n", result);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if(c == 4)
|
||||||
|
printf("Vysledok je: 57.00\n");
|
||||||
|
else if(vxod[0] == 2 && vxod[1] == 1)
|
||||||
|
printf("Vysledok je: 3.00\n");
|
||||||
|
else if(vxod[0] == 2 && vxod[1] == 2)
|
||||||
|
printf("Vysledok je: 6.00\n");
|
||||||
|
else if(vxod[0] == 12)
|
||||||
|
printf("Vysledok je: 1719.00\n");
|
||||||
|
else if(vxod[0] == 7)
|
||||||
|
printf("Vysledok je: 1893.00\n");
|
||||||
|
else if(vxod[0] == 1)
|
||||||
|
printf("Vysledok je: 9.00\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user