Guest User

Untitled

a guest
Oct 27th, 2021
77
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int i, r, c, j, a[101][101], b[101][101], sum;
  5. scanf("%d%d", &r, &c);
  6.  
  7. for(i=1; i<=r; i++)
  8. {
  9. for(j=1; j<=c; j++)
  10. {
  11. scanf("%d", &a[i][j]);
  12. }
  13. }
  14.  
  15. for(i=1; i<=r; i++)
  16. {
  17. for(j=1; j<=c; j++)
  18. {
  19. scanf("%d", &b[i][j]);
  20. }
  21. }
  22.  
  23.  
  24. for(i=1; i<=r; i++)
  25. {
  26. for(j=1; j<=c; j++)
  27. {
  28. sum = a[i][j] + b[i][j];
  29. printf("%d ", sum);
  30. }
  31.  
  32. printf("\n");
  33. }
  34.  
  35.  
  36. return 0;
  37. }
RAW Paste Data