Răspuns :
#include
using namespace std;
int main()
{
int n, uc, pc;
cin >> n;
while(n)
{
uc = n % 10;
n /= 10;
}
pc = n / 10 % 10;
if(pc > uc)
{
cout << pc;
}
else
{
cout << uc;
}
return 0;
}
using namespace std;
int main()
{
int n, uc, pc;
cin >> n;
while(n)
{
uc = n % 10;
n /= 10;
}
pc = n / 10 % 10;
if(pc > uc)
{
cout << pc;
}
else
{
cout << uc;
}
return 0;
}
#include <iostream>
int main() {
std::string n;
std::cin >> n;
if (!n[1])
std::cout << n[0];
else
std::cout << std::max(n[0], n[n.size() - 2]);
}