Update 'du3/program.c'
This commit is contained in:
parent
7b1baf6977
commit
ed0424d4c6
@ -5,21 +5,20 @@
|
||||
|
||||
#define VELKOST_POLA 50
|
||||
int main(){
|
||||
char rip[SIZE];
|
||||
char rip[VELKOST_POLA];
|
||||
memset(rip, '\0', SIZE*sizeof(char));
|
||||
int a = 0;
|
||||
|
||||
for(int b = 0; 1; b++){
|
||||
a = getchar();
|
||||
if(a == EOF || a == '')
|
||||
break;
|
||||
if(a == EOF || a == '')break;
|
||||
rip[b] = a;
|
||||
}
|
||||
for(int c = 0, d = 0; c < strlen(rip); c++){
|
||||
if(rip[c] == '\n'){
|
||||
d++;
|
||||
}
|
||||
else if((rip[c]<='10'&&rip[c]>='0') || (rip[c]=='.') || (rip[c]==EOF) || (rip[c]==''));
|
||||
else if((rip[c]<='6'&&rip[c]>='0') || (rip[c]=='.') || (rip[c]==EOF) || (rip[c]==' '));
|
||||
else if(d == 0){
|
||||
printf("Nepodarilo sa nacitat zaklad x\n");
|
||||
return 0;
|
||||
@ -33,7 +32,7 @@ int kofi = -1;
|
||||
for(int c = 0; c < strlen(rip); c++){
|
||||
if(rip[c] == '\n')
|
||||
continue;
|
||||
else for(int c2 = 0; rip[c]!='\n'; c++; c2++);
|
||||
else for(int c2=0; rip[c]!='\n'; c++, c2++);
|
||||
kofi++;
|
||||
}
|
||||
long double x = 0;
|
||||
@ -51,10 +50,10 @@ for(int c = 0; c < kofi; c++){
|
||||
|
||||
d = dop(x,(kofi-c)-1);
|
||||
|
||||
n+ = d*f;
|
||||
n+=d*f;
|
||||
}
|
||||
n = round(n*100)/100;
|
||||
printf("Vysledok je: %.2Lf\n", n);
|
||||
return STOP;
|
||||
return EXIT_SUCCES;
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user