Last active
January 15, 2020 00:39
-
-
Save georgemorgan/20516131a0212cf3f316 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define z(x) strlen(x) | |
#define d(x) *(char*)(x) | |
#define i(x) d(x++) | |
int t;int c(char*o,char*q){if(*o>9){if(o==q){memmove(q+1,q,++t);d(q)=0;o++;}*o-=10;d(o-1)+=1;c(o-1,q);}}void f(char*a,char*b,char*o){char*l,*s,*q=o;int la,lb,ls;((la=z(a))>(lb=z(b)))?(l=a,s=b):(l=b,s=a);ls=z(s);t=z(l);while((i(o)=i(l)-'0')+'0');o=q+t-1;while(ls--){d(o--)+=d(s+ls)-'0';c(o+1,q);}o=q;while(i(o)+='0');q[t]=0;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Saved you 31 characters.