Language: C++

// C++ program to multiply two numbers represented 
// as strings. 
#include<bits/stdc++.h> 
using namespace std; 

string multiply(string num1, string num2) 
{ 
	int len1 = num1.size(); 
	int len2 = num2.size(); 
	if (len1 == 0 || len2 == 0) 
	return "0"; 

	// will keep the result number in vector 
	// in reverse order 
	vector<int> result(len1 + len2, 0); 

	// Below two indexes are used to find positions 
	// in result. 
	int i_n1 = 0; 
	int i_n2 = 0; 
	
	// Go from right to left in num1 
	for (int i=len1-1; i>=0; i--) 
	{ 
		int carry = 0; 
		int n1 = num1[i] - '0'; 

		// To shift position to left after every 
		// multiplication of a digit in num2 
		i_n2 = 0; 
		
		// Go from right to left in num2			 
		for (int j=len2-1; j>=0; j--) 
		{ 
			// Take current digit of second number 
			int n2 = num2[j] - '0'; 

			// Multiply with current digit of first number 
			// and add result to previously stored result 
			// at current position. 
			int sum = n1*n2 + result[i_n1 + i_n2] + carry; 

			// Carry for next iteration 
			carry = sum/10; 

			// Store result 
			result[i_n1 + i_n2] = sum % 10; 

			i_n2++; 
		} 

		// store carry in next cell 
		if (carry > 0) 
			result[i_n1 + i_n2] += carry; 

		// To shift position to left after every 
		// multiplication of a digit in num1. 
		i_n1++; 
	} 

	// ignore '0's from the right 
	int i = result.size() - 1; 
	while (i>=0 && result[i] == 0) 
	i--; 

	if (i == -1) 
	return "0"; 

	// generate the result string 
	string s = ""; 
	
	while (i >= 0) 
		s += std::to_string(result[i--]); 

	return s; 
} 
string findSum(string str1, string str2) 
{ 
    // Before proceeding further, make sure length 
    // of str2 is larger. 
    if (str1.length() > str2.length()) 
        swap(str1, str2); 
  
    // Take an empty string for storing result 
    string str = ""; 
  
    // Calculate length of both string 
    int n1 = str1.length(), n2 = str2.length(); 
  
    // Reverse both of strings 
    reverse(str1.begin(), str1.end()); 
    reverse(str2.begin(), str2.end()); 
  
    int carry = 0; 
    for (int i=0; i<n1; i++) 
    { 
        // Do school mathematics, compute sum of 
        // current digits and carry 
        int sum = ((str1[i]-'0')+(str2[i]-'0')+carry); 
        str.push_back(sum%10 + '0'); 
  
        // Calculate carry for next step 
        carry = sum/10; 
    } 
  
    // Add remaining digits of larger number 
    for (int i=n1; i<n2; i++) 
    { 
        int sum = ((str2[i]-'0')+carry); 
        str.push_back(sum%10 + '0'); 
        carry = sum/10; 
    } 
  
    // Add remaining carry 
    if (carry) 
        str.push_back(carry+'0'); 
  
    // reverse resultant string 
    reverse(str.begin(), str.end()); 
  
    return str; 
} 
int main() 
{ 
    unordered_map<long long int, string > umap; 
    string str1,str2,s,result="0";
    unsigned long long int n;
    cin>>n;
    unsigned long long int arr[n],i,j,sum,g=1,k=0;
    for(i=0;i<n;i++){
        cin>>arr[i];
    }
    for(i=0;i<n-1;i++){
        for(j=i+1;j<n;j++){
            str1=to_string(arr[i]);
            str2=to_string(arr[j]);
            if((str1.at(0) == '-' || str2.at(0) == '-') && 
		(str1.at(0) != '-' || str2.at(0) != '-' )) 
		cout<<"-"; 


	   if(str1.at(0) == '-' && str2.at(0)!='-') 
		{ 
			str1 = str1.substr(1); 
		} 
		else if(str1.at(0) != '-' && str2.at(0) == '-') 
		{ 
			str2 = str2.substr(1); 
		} 
		else if(str1.at(0) == '-' && str2.at(0) == '-') 
		{ 
			str1 = str1.substr(1); 
			str2 = str2.substr(1); 
		} 
	    s=multiply(str1,str2);
	    cout<<s<<"\n";
	    umap[k++]=s;
        }
    }
    result=umap[0];
    for(j=1;j<k;j++){
       // cout<<umap[i]<<endl;
        result=findSum(result,umap[j]);
    }
    string s1="1000000007";
    sum=stoi(str3);
    cout<<sum%1000000007<<endl;
	return 0; 
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:166:14: error: 'str3' was not declared in this scope; did you mean 'str2'?
  166 |     sum=stoi(str3);
      |              ^~~~
      |              str2