劍指offer:整數中1出現的次數(從1到n整數中1出現的次數)

class Solution { public: int NumberOf1Between1AndN_Solution(int n) { if(n < 1) return 0; if(n == 1) return 1; int sum = 0; for(int i = 1; i <= n; i++) {
相關文章
相關標籤/搜索