Problems
The sum of the first and the last digits in the number
n = abs(int(input())) print(int(str(n)[0])+n%10)
n = str(abs(int(input()))) print(int(n[:1]) + int(n[int(len(n)-1):]))
include <iostream>
include <cmath>
using namespace std;
int main() { int n; cin >> n;
int first_digit = abs(n) % 10;
int last_digit = abs(n);
while (last_digit >= 10) {
last_digit /= 10;
}
int sum = first_digit + last_digit;
cout << sum << endl;
return 0;
}