Advertisement
Guest User

Untitled

a guest
May 28th, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.57 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3.     int i,j,k,l, matriz[100][100], valor;
  4.     scanf("%d",&valor);
  5.     do{
  6.         for(k=1,l=0;l<=valor/2;k++,l++){
  7.         for(i=0+l;i<valor-l;i++){
  8.             for(j=0+l;j<valor-l;j++){
  9.               matriz[i][j]=k;
  10.             }}
  11.         }
  12.         for(i=0;i<valor;i++){
  13.             for(j=0;j<valor;j++){
  14.                 if(j!=valor-1){printf("%3d",matriz[i][j]);}
  15.                 else{printf("%3d\n",matriz[i][j]);}
  16.             }
  17.         }
  18.         printf("\n");
  19.         scanf("%d",&valor);
  20.     }while(valor!=0);
  21.      return 0;
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement