Изменил(а) на 'du3/program.c'
This commit is contained in:
parent
a0a40567d3
commit
ba3e148434
@ -5,6 +5,7 @@
|
||||
#include <math.h>
|
||||
#include <ctype.h>
|
||||
#define LINE_SIZE 150
|
||||
|
||||
int main(){
|
||||
char riadok[LINE_SIZE];
|
||||
memset(riadok, 0,LINE_SIZE);
|
||||
@ -21,14 +22,10 @@ int main(){
|
||||
//float p = 0;
|
||||
while(stop == 0){
|
||||
r = fgets(riadok,LINE_SIZE,stdin);
|
||||
if(feof(stdin)){
|
||||
break;
|
||||
}
|
||||
pos++;
|
||||
|
||||
if (r == NULL || !isdigit(*r) || *r == EOF || feof(stdin)) {
|
||||
if (r == NULL || !isdigit(*r) || *r == EOF) {
|
||||
//printf("%d", *r);
|
||||
if(*r == 10){
|
||||
if(*r == 10 || r == NULL){
|
||||
stop = 1;
|
||||
}
|
||||
else{
|
||||
@ -42,12 +39,17 @@ 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);
|
||||
|
Loading…
Reference in New Issue
Block a user