Monk and Welcome Problem

#include<iostream>
using namespace std;

int main(){
    long long int n,tr, ary1[100000],ary2[100000],d;
    cin>>n;
    for(int i=0; i<n; i++){
      cin>>ary1[i];
      }
    for(int j=0;j<n;j++){
      cin>>ary2[j];
    }
    for(int t=0; t<n; t++){
        tr=ary1[t]+ary2[t];
        cout<<tr<<" ";
    }

return 0;
}

Another Problem:

#include<bits/stdc++.h>
using namespace std;

int main(){
    long long int n,tr, ary1[100000],ary2[100000],d;
    cin>>n;
    for(int i=0; i<n; i++){
      cin>>ary1[i];
      }
    for(int i=0;i<n;i++){
      cin>>ary2[i];
      ary2[i]=ary2[i]+ary1[i];
    }
    for(int i=0; i<n; i++){
        cout<<ary2[i]<<" ";
    }

return 0;
}

 

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *