class Solution { public: int Add(int num1, int num2) { while (num2--) { num1++; } return num1; } };
剑指offer---求1+2+3.....+n
原文:http://www.cnblogs.com/159269lzm/p/7288469.html