# Include "iostream" # include "string" # include "string. H "# include" sstream "using namespace STD; int main () {int t; string str1, str2; // The input two integers are represented by strings CIN> T; while (t --) {CIN> str1> str2; int length1 = str1.size (); int lengh2 = str2.size (); int * A = new int [length1]; int * B = new int [lengh2]; for (INT I = 0; I <length1; I ++) // converts a string to a number, save in the array {stringstream S1; S1 <str1 [I]; S1> A [I];} For (INT I = 0; I <leng2; I ++) {stringstream S2; S2 <str2 [I]; S2> B [I];} int * c = new int [length1 + leng22. // The C array stores the result memset (C, 0, 4*(length1 + leng22.) after the two integers are multiplied )); int S = 0; For (INT I = length2-1; I> = 0; I --, s ++) {int K = s; For (Int J = length1-1; j> = 0; j --) // obtain the result based on the multiplication law {C [k] + = A [J] * B [I]; k = k + 1 ;}}for (INT I = 0; I <(length1 + length1); I ++) // determines whether carry is required! If (C [I]> = 10) {C [I + 1] + = C [I]/10; C [I] = C [I] % 10 ;} int Q; For (q = (length1 + length1)-1; q> = 0; q --) // you can check whether there is 0 in front of the array. If so, remove it! {If (C [Q]! = 0) {for (INT I = Q; I> = 0; I --) cout <C [I]; break;} If (q = 0) // if all the values in the array are 0, output 0! Cout <0 ;}cout <Endl ;}}