int get_len(char *s){ int i = 0; while(*s++ != '\0') i++; return i; } char*
reverse(char *s, int len){ int i=0, j=len-1; while(i<j){ char tmp = s[i];s[i] =
s[j];s[j] = tmp; i++;j--; } return s; } #define LEN 1000 char * addBinary(char
* a, char * b){ int len1 = get_len(a); int len2 = get_len(b); char *ret = (char
*)malloc(sizeof(char) * (LEN)); int i = 0; int j=0; int flag =0; int tmp; int
index=0; memset(ret, 0, LEN); reverse(a,len1); reverse(b, len2); while(i<len1
|| j<len2 || flag){ tmp = flag + (i<len1?(a[i]-'0'):0) + (j<len2?(b[j]-'0'):0);
printf("i=%d, j=%d, tmp=%d, flag=%d\n", i, j, tmp, flag); flag = 0; if(tmp>=2){
tmp -= 2; flag = 1; } ret[index++] = '0' + tmp; i++; j++; } return reverse(ret,
index); }

Technology
©2019-2020 Toolsou All rights reserved,
el-select At the same time label and value value Science fiction comes true !“ Trisomy ” Found out vue-countTo Complete operation Shortest path Dijkstra (Python3) Thoughts on multi tenant system Mybatis Mapping file Mapper.xml in # and $ The difference between python Short circuit logic in airflow Question series 2 —— task keep running Suspended animation ( Essence )2020 year 6 month 26 day C# Class library model PageInputVue el-select obtain label value