Hàm tính tổng các phần tử trên cùng một dòng.


void tongpttrendong(int a[][100],int n,int m)
{
    for(int i=0;i<n;++i)
    {
        int S=0;
        for(int j=0;j<m;++j)
            S+=a[i][j];
        cout<<"dong "<<i<<" la: "<<S<<endl;
    }
}

Share this

Related Posts

Previous
Next Post »