标签:span class bsp for return push tor back color
1 class Solution 2 { 3 public: 4 bool isPalindrome(int x) 5 { 6 if(x < 0) return false; 7 vector<int> nums; 8 while(x) 9 { 10 nums.push_back(x % 10); 11 x /= 10; 12 } 13 int n = nums.size(); 14 for(int i = 0;i < n;i ++) 15 { 16 if(nums[i] != nums[n - i - 1]) return false; 17 } 18 return true; 19 } 20 };
标签:span class bsp for return push tor back color
原文地址:https://www.cnblogs.com/yuhong1103/p/12499099.html