标签:
伪代码:
for i=n-1 downto 0 if A[i]+B[i]==0 //情况1 if flag==0 C[i+1]=0 else C[i+1]=1 flag=0 elseif A[i]+B[i]==1 //情况2 if flag==0 C[i+1]=1 else C[i+1]=0 flag==1 else //情况3 if flag==0 C[i+1]=0 else C[i+1]=1 flag==1
C[0]=flag
标签:
原文地址:http://www.cnblogs.com/Wanggcong/p/4705420.html