Advertisement
Guest User

Untitled

a guest
May 28th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1.  
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. int main()
  7. {
  8. int n,i,j,mat[100][100],suma,k;
  9. scanf("%d",&n);
  10. for(i=0;i<n;i++)
  11. {
  12. for(j=0;j<n;j++)
  13. {
  14. scanf("%d",&mat[i][j]);
  15. }
  16. }
  17.  
  18.  
  19. for(i=0;i<n;i++)
  20. {
  21. suma=0;
  22. for(j=0;j<n;j++)
  23. {
  24. suma+=mat[i][j];
  25.  
  26. }
  27. printf("%d \n",suma);
  28. }
  29.  
  30. for(i=0;i<n;i++)
  31. {
  32. for(j=0;j<n;j++)
  33. {
  34. printf("%d",mat[i][j]);
  35. }
  36. printf("\n");
  37. }
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement