Aktualizovat „du4/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-04-02 23:56:53 +00:00
parent 28daab5c2e
commit 37145fb7db

View File

@ -52,19 +52,9 @@ double compare_percent(double a, double b, double eps)
int main() int main()
{ {
char str[100][100]; char str[100][100];
int i =0;
int j =0;
char b ; char b ;
while((b=getchar())!=EOF){ for(int i =0;fgets(str[i],100,stdin);i++){
if(b=='\n'){ char *new_str = compactString(str[i],strlen(str[i]));
j=0;
i++;
}
str[i][j]=b;
j++;
}
for(int k=0;k<=i-1;k++){
char *new_str = compactString(str[k],strlen(str[k]));
double first =-5,second =-5,res=-5; double first =-5,second =-5,res=-5;
char c='E'; char c='E';
sscanf(new_str,"%lf%c%lf%*[=]%lf",&first,&c,&second,&res); sscanf(new_str,"%lf%c%lf%*[=]%lf",&first,&c,&second,&res);