题目描述
blablabla
C++ 代码
#include<iostream>
using namespace std;
int pi(int x)
{
int temp = 0;
while (x != 0) {
if (temp > INT_MAX / 10 || temp < INT_MIN / 10)
return 0;
temp = temp * 10 + x % 10;
x = x / 10;
}
return temp;
}