StoneHaos

326

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