Advertisement
MasWag

855264583.c

Mar 11th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. double dF[10];
  5. double sF[10];
  6. double dFs[10];
  7. double sFs[10];
  8.  
  9. int main(void)
  10. {
  11.   int i;
  12.   int t = 1;
  13.   int ans;
  14.  
  15.   for (i = 0;i < 10;++i)
  16.     {
  17.       double F,Fs;
  18.       F = 0.111111 * i;
  19.       dF[i] = F * 2;
  20.       sF[i] = F * F;
  21.       Fs = F + 0.000001;
  22.       dFs[i] = Fs * 2;
  23.       sFs[i] = Fs * Fs;
  24.     }
  25.   while (1)
  26.     {
  27.       for (i = 0;i < 10;++i)
  28.     {
  29.       if (floor (sF[i] + t * dF[i]) != floor (sFs[i] + t * dFs[i]) && floor (sFs[i] + t * dFs[i]) != sFs[i] + t * dFs[i])
  30.         {
  31.           ans = sFs[i] + t * dFs[i] + t * t;
  32.           goto end;
  33.         }
  34.     }
  35.       t++;
  36.     }
  37.  end:
  38.   printf ("%d\n",ans);
  39.  
  40.   return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement