Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int a,num1,num2,temp1,temp2;
  6. cin>>a;
  7. if(a>=0)
  8. {
  9. cout<<a<<endl;
  10. exit(0);
  11. }
  12.  
  13. if(a < 0)
  14. {
  15. num1 = a;
  16. num2 = a;
  17. temp1=num2%10;
  18. num2=num2/10;
  19. temp2=num2%10;
  20. num2=num2-temp2+temp1;
  21. num1 = num1/10;
  22. }
  23. if(num1>num2) cout<<num1<<endl;
  24. else cout<<num2<<endl;
  25.  
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement