#include<stdio.h>#include<stdbool.h>#include<string.h>#include<stdlib.h>#defineMAXLEN20intarr1[MAXLEN];intarr2[MAXLEN];charstr1[MAXLEN];charstr2[MAXLEN];voidconvertBin(intintNum){staticintbitSize=32;intmodBin=intNum&1;intmodNum=intNum>>1;if(bitSize--)convertBin(modNum);printf("%d",modBin);}intadd(inta,intb){returnb?add(a^b,(a&b)<<1):a;}intcomplementNum(intb){returnadd(~b,1);}intMin(inta,intb){returnadd(a,complementNum(b));}intMul(inta,intb){intsum=0;intisNeg=(a>0)^(b>0);unsignedintnum=(a>0)?a:complementNum(a);unsignedintnumAdd=(b>0)?b:complementNum(b);while(numAdd){if(numAdd&1)sum=add(num,sum);numAdd=numAdd>>1;num=num<<1;}returnisNeg?complementNum(sum):sum;}intPow(inta,intb){intsum=1,q=a;while(b){if(b&1)sum=Mul(sum,q);b>>=1;q=Mul(q,q);}returnsum;}intdivision(inta,intb){intnum=0;intisNeg=(a>0)^(b>0);unsignedintnum1=a>0?a:complementNum(a);unsignedintnum2=b>0?b:complementNum(b);while(num1){if(num1>=num2){num1=Min(num1,num2);num=add(1,num);}elsebreak;}returnisNeg?complementNum(num):num;}intMod(inta,intb){intisNeg=(a>0)^(b>0);unsignedintnum1=a>0?a:complementNum(a);unsignedintnum2=b>0?b:complementNum(b);intmodNum;while(num1){modNum=num1;if(num1>=num2){num1=Min(num1,num2);}else{break;}}returnisNeg?complementNum(modNum):modNum;}intmain(void){//大数求和有待封装printf("PleaseInputStr1:\n");scanf("%s",&str1);printf("PleaseInputStr2:\n");scanf("%s",&str2);intstrLen1=strlen(str1);intstrLen2=strlen(str2);inti,k;intj=0,l=0;for(i=strLen1-1;i>=0;i--){arr1[j++]=str1[i]-'0';}for(k=strLen2-1;k>=0;k--){arr2[l++]=str2[k]-'0';}for(i=0;i<MAXLEN;i++){arr1[i]+=arr2[i];if(arr1[i]>=10){arr1[i]-=10;arr1[i+1]++;}}_BoolskipFlag=false;for(i=MAXLEN-1;i>=0;i--){if(skipFlag){printf("%d",arr1[i]);}elseif(arr1[i]){printf("%d",arr1[i]);skipFlag=true;}}if(!skipFlag)printf("0");return0;intintNum,addNum,minNum,num1,num2;printf("PleaseInputanInteger:\n");scanf("%d",&num1);printf("PleaseInputanotherInteger:\n");scanf("%d",&num2);printf("%d/%d=%d\n",num1,num2,division(num1,num2));printf("%d求余%d=%d\n",num1,num2,Mod(num1,num2));//printf("%d^%d=%d\n",num1,num2,Pow(num1,num2));//addNum=add(num1,num2);//minNum=Min(num1,num2);//printf("%d+%d=%d\n",num1,num2,addNum);//printf("%d-%d=%d\n",num1,num2,minNum);//scanf("%d",&intNum);//printf("%d&1=%d%d&0x01=%d",num1,num1&1,num1,num1&0x01);//printf("%d\n",intNum>>=1);//convertBin(intNum);//printf("\n");return0;}