fork download
  1. #include <cstdint>
  2. #include <iostream>
  3. #include <sstream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. ios_base::sync_with_stdio(false);
  9. cin.tie(nullptr);
  10.  
  11. uint_fast64_t i, j;
  12. stringstream inp;
  13. inp << cin.rdbuf();
  14. stringstream outp;
  15. while(!(inp >> i >> j).eof()) {
  16. if(i > j)
  17. outp << i-j << '\n';
  18. else
  19. outp << j-i << '\n';
  20. }
  21. cout << outp.rdbuf();
  22. }
  23.  
Success #stdin #stdout 0s 15240KB
stdin
10 12
10 14
100 200
stdout
2
4
100