#define_crt_secure_no_warnings#include<stdio.h>#include<stdlib.h>#include<string.h>//C Language Declaration variables need to be added stuct//there can be no function inside C language structure//C-language struct has no public, private, inheritedstructmystruct{intNUM1; intnum2; };structmystruct MyStruct1;///addition, subtraction///1234.567x12345.987///15k+ Division,//————————voidGetbigdata (Char*dataa,Char*Datab) { intLengtha =strlen (DATAA); intLENGTHB =strlen (Datab); int*pres = (int*)malloc(sizeof(int) * (Lengtha +LENGTHB)); memset (pres,0,sizeof(int) * (Lengtha + LENGTHB));//Initialize//Tired Ride for(inti =0; I < lengtha;i++) { for(intj =0; J < lengthb;j++) {pres[i+j+1]+= (Dataa[i]-'0') * (Datab[j]-'0'); } } //Rounding for(inti = Lengtha + lengthb-1; i>=0; i--) { if(pres[i]>=Ten)//Rounding{pres[i-1] + = Pres[i]/Ten;//RoundingPres[i]%=Ten;//Remove single digit } } inti =0; while(pres[i]==0) {i++;//A position that is not exactly 0 } Char*lastres =malloc(sizeof(Char) * (Lengtha +LENGTHB)); intJ; for(j =0; J < Lengtha + LENGTHB; J + +, i++) {Lastres[j]= Pres[i] +'0'; } Lastres[j]=' /'; printf ("Last result =%s", lastres);}voidMain () {Charstr1[ -] = {0 }; Charstr2[ -] = {0 }; scanf ("%s%s", str1, str2); printf ("str1=%s,str2=%s", str1, str2);//Print ResultsGetbigdata (str1, str2); //strcpy (str1, "123123");System ("Pause");}
Large number multiplication