Изменил(а) на 'du3/program.c'

This commit is contained in:
Vladyslav Korzun 2023-03-06 17:09:13 +00:00
parent ba3e148434
commit b2f5720625

View File

@ -5,7 +5,6 @@
#include <math.h>
#include <ctype.h>
#define LINE_SIZE 150
int main(){
char riadok[LINE_SIZE];
memset(riadok, 0,LINE_SIZE);
@ -23,9 +22,9 @@ int main(){
while(stop == 0){
r = fgets(riadok,LINE_SIZE,stdin);
pos++;
if (r == NULL || !isdigit(*r) || *r == EOF) {
if (r == NULL || !isdigit(*r)) {
//printf("%d", *r);
if(*r == 10 || r == NULL){
if(*r == 10){
stop = 1;
}
else{
@ -39,17 +38,12 @@ int main(){
}
}
}
else if (*r == EOF) {
stop = 1;
}
else {
r2 = atof(riadok);
mass[i] = r2;
//printf("%.2f\n", r2);
i++;
//printf("%d\n", i);
}
}
x = mass[0];
vysl = x;
//printf("%d\n", x);