Изменил(а) на 'du3/program.c'
This commit is contained in:
parent
5ca27b2962
commit
a7a72ded64
@ -8,6 +8,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#define LINE_SIZE 150
|
||||
|
||||
int main(){
|
||||
@ -34,11 +36,17 @@ int main(){
|
||||
|
||||
float h = 0;
|
||||
|
||||
//float p = 0;
|
||||
|
||||
while(stop == 0){
|
||||
|
||||
r = fgets(riadok,LINE_SIZE,stdin);
|
||||
|
||||
assert(r!=NULL);
|
||||
if (r == NULL || !isdigit(*r)) {
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
r2 = atof(riadok);
|
||||
|
||||
@ -48,14 +56,6 @@ int main(){
|
||||
|
||||
i++;
|
||||
|
||||
if (r2 == 0){
|
||||
|
||||
//printf("Konverzia sa nepodarila alebo v reťazci sa nachádza nula.\n");
|
||||
|
||||
stop++;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
x = mass[0];
|
||||
@ -68,13 +68,13 @@ int main(){
|
||||
|
||||
h = mass[j];
|
||||
|
||||
//printf("h>>> %1.f\n", h);
|
||||
printf("h>>> %1.f\n", h);
|
||||
|
||||
if(counter == -1){
|
||||
|
||||
vysl = x * h + mass[j + 1];
|
||||
|
||||
//printf("vysl>>> %1.f\n", vysl);
|
||||
printf("vysl>>> %1.f\n", vysl);
|
||||
|
||||
counter++;
|
||||
|
||||
@ -86,7 +86,7 @@ int main(){
|
||||
|
||||
vysl = x * vysl + mass[j + 1];
|
||||
|
||||
//printf("vysl22>>>>> %1.f\n", vysl);
|
||||
printf("vysl22>>>>> %1.f\n", vysl);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user