zmeny
This commit is contained in:
parent
740c929e72
commit
256e70de10
@ -1,11 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int value = 0;
|
||||
int r = scanf("%d", value);
|
||||
if (r == 1){
|
||||
printf("Uspesne som nacital hodnotu %d\n", value);
|
||||
}
|
||||
else {
|
||||
printf("Nacitanie sa neporadilo. V premennej value ostala povodna hodnota. \n");
|
||||
}
|
||||
|
||||
@ -3,4 +3,22 @@
|
||||
#include <string.h>
|
||||
|
||||
#define VELKOST_POLA 52
|
||||
int main(){
|
||||
int x[6], i, j, k;
|
||||
int a[6] = {3, 5, 2, 4, 1, 6};
|
||||
printf("Enter the values of x: \n");
|
||||
for(i = 0; i < 6; i++){
|
||||
scanf("%d", &x[i]);
|
||||
}
|
||||
int y = 0;
|
||||
for(j = 5; j >= 0; j--){
|
||||
k = 1;
|
||||
for(i = 0; i < j; i++){
|
||||
k = k*x[i];
|
||||
}
|
||||
y = y + a[j]*k;
|
||||
}
|
||||
|
||||
printf("y = %d\n", y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user