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