Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int a,num1,num2,temp1,temp2;
- cin>>a;
- if(a>=0)
- {
- cout<<a<<endl;
- exit(0);
- }
- if(a < 0)
- {
- num1 = a;
- num2 = a;
- temp1=num2%10;
- num2=num2/10;
- temp2=num2%10;
- num2=num2-temp2+temp1;
- num1 = num1/10;
- }
- if(num1>num2) cout<<num1<<endl;
- else cout<<num2<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement