Advertisement
StoneHaos

828

Nov 2nd, 2019
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement