Threadser.net
數據
關鍵字
功能建議
Blog
Following
Threads
Change language
登入
串文
串文鏈結
2024-10-30 19:14
You are given two integers: a and b You have to calculate the sum of a and b. BUT you cannot use the '+' operator. How'd you do it?
讚
36
回覆
150
轉發
作者
Ramon Sorage
rsorage
粉絲
108
串文
151+
讚
回覆
轉發
24小時粉絲增長
發文前
35
發文後24小時
108
變化
+73 (208.57%)
互動率
(讚 + 回覆 + 轉發) / 粉絲數
172.22%
回覆 (BETA)
最先回覆的內容
發文後
用戶
內容
一小時內
Timo Vandrey
timovandrey
Use a Full-Adder-Circuit or a software implementation of it.
3 小時內
Lukáš Habarta
habarta.luke
recursive bitwise operations. AND between a, b. XOR between a,b. Result of AND is now a, result of XOR is now b. Repeat until result of AND is 0, at this moment, the result of XOR is the sum of original a and b.
4 小時內
Kevin Moor
kevinwmoor
ADD A TO B GIVING C 😋
4 小時內
Brian Glass
squatch309
=sum(A,B)
7 小時內
Woulg
woulg
Convert to strings, concatenate with "please add these numbers", chatgpt or fivver, boom. Peak efficiency, sleek design. But seriously isn't in like xor and then and or something like that, I saw the answer somewhere recently
7 小時內
Woulg
woulg
def add(a, b): answer = random(128) result = input(f"is the answer {answer}") If answer != "yes": add(a,b) else: print("took you long enough...") return answer
13 小時內
夢之碎片
dream7fragment
draw a line with angle arctan(a) and y-int b measure the y value at x=1
16 小時內
wibenji
wibenji
sum= (a-2a-b) x (-1)
20 小時內
Paul Stewart
dunemouse
A - (-b)
20 小時內
Shantanu
sha_nta_nu.s
A bar AND B bar