cReTzUUUU Posted July 29, 2020 Posted July 29, 2020 #include <iostream> using namespace std; int main() { int n,i,j,a[10][10],b[10][10],c[10][10]; cout<<"Introduceti gradul matricei:"; cin>>n; for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ cout<<"A["<<i<<"]["<<j<<"]="; cin>>a[i][j]; }} for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ cout<<"B["<<i<<"]["<<j<<"]="; cin>>b[i][j]; }} for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ c[i][j]=a[i][j]+b[i][j]; }} for(i=1;i<=n;i++){ for(j=1;j<=n;j++) cout<<c[i][j]<<" "; cout<<endl; } return 0; } 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now