Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.65 KB | None | 0 0
  1. str = ReadLine(fin);
  2.         if (str != NULL)
  3.         {
  4.             fprintf(fout, "%s", str);
  5.             i = 0;
  6.             while (isspace(str[i]) != 0)
  7.                 i++;
  8.             if (str[i] == 0 || ((str[i + 1] == '/') && (str[i] == '/')))
  9.             {
  10.                 fprintf(fout, "\n");
  11.             }
  12.             else
  13.             {
  14.                 if (i > 0)
  15.                     fprintf(fout, " == ERROR: impossible\n");
  16.                 else
  17.                 {
  18.                     for (i = 0; str[i] != 0; i++)
  19.                     {
  20.                         if (str[i] == '(')
  21.                             inp++;
  22.                         if (str[i] == ')')
  23.                             exp++;
  24.                     }
  25.                     if (inp != exp)
  26.                     {
  27.                         fprintf(fout, " == ERROR: not skobok\n");
  28.                         inp = 0;
  29.                         exp = 0;
  30.                     }
  31.                     else
  32.                         fprintf(fout, " == %g\n", 56.676);
  33.                 }
  34.             }
  35.             free(str);
  36.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement