StoneHaos

828

Nov 2nd, 2019
136
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //828
  2. #include <cstdio>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main(void) {
  7.     FILE* fin = fopen("input.txt", "r");
  8.     FILE* fout = fopen("output.txt", "w");
  9.  
  10.     int a[3];
  11.     fscanf(fin, "%d%d%d", a, a + 1, a + 2);
  12.     fclose(fin);
  13.     sort(a, a + 3);
  14.     fprintf(fout, "%d\n", a[2] - a[1] + a[1] - a[0]);
  15.     fclose(fout);
  16.     return 0;
  17. }
RAW Paste Data