Aktualizovat „du4/program.c“
This commit is contained in:
parent
28daab5c2e
commit
37145fb7db
@ -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);
|
||||||
@ -82,6 +72,6 @@ int main()
|
|||||||
printf("ZLE\n");
|
printf("ZLE\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user