介绍
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.
Example:
Given a = 1 and b = 2, return 3.
思路
。。。太简单了啊,利用python内置的一些有求和功能的函数来代替+号不就行了,比如列表的sum函数
代码
|
|
随手笔记
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.
Example:
Given a = 1 and b = 2, return 3.
。。。太简单了啊,利用python内置的一些有求和功能的函数来代替+号不就行了,比如列表的sum函数
|
|