Оновити 'cv3/program.c'
This commit is contained in:
parent
9edadc9d72
commit
dcbdb29615
@ -1 +1,21 @@
|
|||||||
#include <stdio.h>
|
#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;
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user