标签:code cout bsp long 每日一题 rgb 整数 div rev
class Solution { public: int reverse(int x) { // cout << 1111 << endl; long long ret = 0; long long y = x; int f = 0; if(y < 0) f = 1, y = -y; // cout << 1111 << endl; while(y) { int tmp = y % 10; ret = ret * 10 + tmp; y /= 10; } if(f) ret = -ret; if(ret < INT_MIN || ret > INT_MAX) return 0; // if(f) ret = -ret; //cout << 111 << endl; return (int)ret; } };
标签:code cout bsp long 每日一题 rgb 整数 div rev
原文地址:https://www.cnblogs.com/WTSRUVF/p/14727711.html