Wrong Answer Showing Please Help

Problem Link: https://www.codechef.com/problems/MATCHES

#include<iostream>
#include<map> 
using namespace std;
int main(){
    map<int,int> num{ {0,6},{1,2},{2,5},{3,5},{4,4},{5,5},{6,6},{7,3},{8,7},{9,4}};
    int t;
    cin >> t;
    while(t--){
        long long int a,b,x,c=0;
        cin >> a >> b;
        x=a+b;
        while(x>=1){
            int m=x%10;
            c+=num[m];
            x/=10;
           
        }
        cout << c << endl;
    }
}

For 9 you need 6 matches {9, 6};

Thanks did not pay attention

#include
using namespace std;

int main() {
int t;
cin>>t;
while(t–)
{
int a,b;
cin>>a>>b;

    int mat[10]={6,2,5,5,4,5,6,3,7,6};
    
    int no=a+b;
    
    int dig;
    
    int tot=0;
    
    while(no!=0)
    {
        dig=no%10;
        tot+=mat[dig];
        no/=10;
    }
    
    cout<<tot<<endl;
}

}

:v: