21 lines
472 B
C
21 lines
472 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <stdbool.h>
|
|
#include <ctype.h>
|
|
#define MAX_I_LINE_LENGTH 256
|
|
int main(){
|
|
char line[MAX_I_LINE_LENGTH];
|
|
int cfIdx = 0;
|
|
double x, cf,result = 0;
|
|
fgets(line, 100, stdin);
|
|
x = strtod(line, NULL);
|
|
while(line[0] != '\n'){
|
|
result = result * x + cf;
|
|
fgets(line, 100, stdin);
|
|
cf = strtod(line,NULL);
|
|
}
|
|
printf("Vysledok je: %.2f\n", result);
|
|
return 0;
|
|
|
|
} |