Language: C++

#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
  
using namespace std;
  
int main(){
      
    int n;
    cin>>n;
      
    while(n-- > 0){
        vector<int> ans;
        vector<int> a;
        vector<int> b;
          
        string c,d;
        cin>>c>>d;
          
        for(int i = 0; i < (int)c.size(); ++i){
            a.push_back(c[c.size()-1-i]-'0');
        }
        for(int i = 0; i < (int)d.size(); ++i){
            b.push_back(d[d.size()-1-i]-'0');
        }
          
          
        int kuri = 0;
        while(!a.empty() || !b.empty() || kuri!=0){
            int sum = kuri;
            kuri = 0;
              
            if(!a.empty()){
                sum += a[0];
                a.erase(a.begin());
            }
              
            if(!b.empty()){
                sum += b[0];
                b.erase(b.begin());
            }
              
            ans.push_back(sum%10);
            kuri += sum/10;
        }
          
        if(ans.size()>80)puts("overflow");
        else{
            for(int i = 0; i < (int)ans.size(); ++i){
                printf("%d",ans[ans.size()-1-i]);
            }puts("");
        }
    }
      
}
 
/*
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
 
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
     
    int n;
    cin >> n;
     
    while(n-- > 0){
     
    string str1;
    cin >> str1;
     
    string str2;
    cin >> str2;
     
    reverse(str1.begin(), str1.end());
    reverse(str2.begin(), str2.end());
     
    int check;
    if(str1.size() > str2.size()){
        check = 1;
    }
    else if(str1.size() == str2.size()){
        check = 2;
    }
    else {
        check = 3;
    }
     
    int ans[100];
    bool next = false;
    int short_ = min(str1.size(), str2.size());
    int long_ = max(str1.size(), str2.size());  
    if(long_ >= 80){
        cout << "overflow" << endl;
        continue;
    }
 
    for(int i = 0; i < short_; ++i){
        int num = 0;
        num += (str1[i] - '0') + (str2[i] - '0');
        if(next){
            num++;
        }
        ans[i] = num;
        next = false;   
        if(num >= 10){
            num -= 10;
            ans[i] -= 10;
            next = true;
        }
    }
     
    if(check == 1){
        for(size_t i = str2.size(); i < str1.size(); ++i){
            int num = str1[i] - '0';
            if(next){
                num++;
            }
            ans[i] = num;
            next = false;   
            if(num >= 10){
                num -= 10;
                ans[i] -= 10;
                next = true;
            }
        }
        if(next){
            ans[str1.size()] = 1;
            long_ ++;
        }
    }   
     
    if(check == 3){
        for(size_t i = str1.size(); i < str2.size(); ++i){
            int num = str2[i] - '0';
            if(next){
                num++;
            }
            ans[i] = num;
            next = false;   
            if(num >= 10){
                num -= 10;
                ans[i] -= 10;
                next = true;
            }
        }
        if(next){
            ans[str2.size()] = 1;
            long_ ++;
        }
    }
     
    if(long_ >= 80){
        cout << "overflow" << endl;
        continue;
    }
 
    for(int i = long_ - 1; i >= 0; --i){
        cout << ans[i];
    }   
    cout << endl;
    }
         
    return 0;
}

Compiler output:
a.cc:64:1: error: unterminated comment
   64 | /*
      | ^