fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a,b,c;
  6. scanf("%d", &a);
  7. scanf("%d", &b);
  8. if(a<0)
  9. a=-1*a;
  10. if(a<b)
  11. c=a-b;
  12. else
  13. c=b-a;
  14. printf("%d %d %d", a, b, c);
  15. return 0;
  16. }
Success #stdin #stdout 0s 5284KB
stdin
2 -1
stdout
2 -1 -3