Phoenix_Hijacker

pyrmid

May 19th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int const n=4;
  4. int main (){
  5. int i, j,k,mat[n][n]={};
  6.  
  7. for (k = 0; k < n/2; k++) {
  8. for (i = k; i < n-k; i++) {
  9. for (j = k; j < n-k; j++) {
  10. mat[i][j]++;
  11. }
  12. }
  13. }
  14.  
  15. for (i = 0; i < n; i++) {
  16. for (j = 0; j < n; j++) {
  17. cout << mat[i][j] << ' ';
  18. }
  19. cout << endl;
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment