StoneHaos

626

Nov 2nd, 2019
174
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //626
  2. #include <cstdio>
  3. #include <cmath>
  4.  
  5. int main(void) {
  6.     FILE* fin = fopen("input.txt", "r");
  7.     FILE* fout = fopen("output.txt", "w");
  8.  
  9.     int k, x, y;
  10.     fscanf(fin, "%d%d%d", &k, &x, &y);
  11.     fclose(fin);
  12.     if (abs(k - x) < abs(k - y))
  13.         fprintf(fout, "1\n");
  14.     else if (abs(k - y) < abs(k - x))
  15.         fprintf(fout, "2\n");
  16.     else
  17.         fprintf(fout, "0\n");
  18.     fclose(fout);
  19.     return 0;
  20. }
RAW Paste Data