Describe
A difference of two large positive integers.
Enter a total of 2 lines, the 1th line is the meiosis A, and the 2nd line is B (a > B). Each large integer does not exceed 200 bits, and there is no redundant leading zeros. The output line, that is, the difference of the request. Sample input
99999999999999999999999999999999999999999999999999
Sample output
9999999999999999999999990000000000000
1#include <stdio.h>2#include <string.h>3 inta[201]={0}, b[201]={0};4 inti, KA, KB, k,c,temp,len;5 Chars[201];6 voidminus ()7 {8 for(i =0; i < ka; i++)9 {Ten if(A[i] <B[i]) One { AC=1; -a[i+1]--; - } the Else -C=0; -A[i] = a[i]+c*Ten-B[i]; -k=Ka; + while(a[k-1]==0&& k>0) -k--; + } A } at intMain () - { -scanf"%s", s); -k=0; len=strlen (s); - while(k<len) - { ina[k]=s[k]-'0'; -k++; to } +Ka=K; -scanf"%s", s); thek=0; len=strlen (s); * while(k<len) $ { Panax Notoginsengb[k]=s[k]-'0'; -k++; the } +kb=K; A if(Ka >= kb) k =Ka; the Else +K =kb; - for(i =0; I < ka/2; i++) $ { $temp=A[i]; -a[i]=a[ka-i-1]; -a[ka-1-I.] =temp; the } - for(i =0; I < kb/2; i++)Wuyi { thetemp=B[i]; -b[i]=b[kb-i-1]; Wub[kb-1-I.] =temp; - } AboutC=0; $ minus (); - for(i = k-1; I >=0; i--) -printf"%d", A[i]); - return 0; A}
1-6-11: Large integer Subtraction