#include
#include
using namespace std;
int main()
{
int number, coun = 0, d, first, last;
double pwr;
setlocale(LC_ALL, "Russian");
cout << "Поменять первую и последнюю цифры числа>"
cout
cin >> number;
d = number;
while (d > 0)
{
d /= 10;
coun++;
cout
}
pwr = pow(10, coun-1);
//к примеру число равно 321
//first = 3
//last = 1
//number = 32
//number = 323
//number = 23
//number = 123
first = number / (int)pwr;
last = number % 10;
number /= 10;
number = number * 10 + first;
number %= int(pwr);
number += last * int(pwr);
cout
return 0;
}