301639: CF313A. Ilya and Bank Account
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Ilya and Bank Account
题意翻译
## 题目描述 Ilya是一只灰常聪明的狮子,他住在一座不同寻常的城市中——动物园!在这座城市中,每一只动物都有它的权利与义务。它们甚至都有自己的银行账户。银行账户包含一个整数,其中有可能是负数(说明它欠钱了)。 Ilya最近要过生日了,所以他收到了一系列礼物。其中一个礼物(动物园总行)可以让它消除它银行账户上的最后一位或倒数第二位数字(**就一次**)。比如说,如果Ilya的账户上余额为-123,那么他可以消除3得到-12,或者消除2得到-13(当然它不傻,知道欠钱越少越好)。Ilya也可以不消除数字。 现在,Ilya要你帮他算出它最多有多少钱。 ## 输入输出格式 ##### 输入格式 一行一个整数 $n$($10\le|n|\le 10^9$) ##### 输出格式 一行一个整数,表示他最多有多少钱。 ## 说明 第一个样例中,狮子没有用那个礼物消除数。 第二个样例中,狮子消除了1得到0。题目描述
Ilya is a very clever lion, he lives in an unusual city ZooVille. In this city all the animals have their rights and obligations. Moreover, they even have their own bank accounts. The state of a bank account is an integer. The state of a bank account can be a negative number. This means that the owner of the account owes the bank money. Ilya the Lion has recently had a birthday, so he got a lot of gifts. One of them (the gift of the main ZooVille bank) is the opportunity to delete the last digit or the digit before last from the state of his bank account no more than once. For example, if the state of Ilya's bank account is -123, then Ilya can delete the last digit and get his account balance equal to -12, also he can remove its digit before last and get the account balance equal to -13. Of course, Ilya is permitted not to use the opportunity to delete a digit from the balance. Ilya is not very good at math, and that's why he asks you to help him maximize his bank account. Find the maximum state of the bank account that can be obtained using the bank's gift.输入输出格式
输入格式
The single line contains integer $ n $ $ (10<=|n|<=10^{9}) $ — the state of Ilya's bank account.
输出格式
In a single line print an integer — the maximum state of the bank account that Ilya can get.
输入输出样例
输入样例 #1
2230
输出样例 #1
2230
输入样例 #2
-10
输出样例 #2
0
输入样例 #3
-100003
输出样例 #3
-10000