Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int i,j,k,l, matriz[100][100], valor;
- scanf("%d",&valor);
- do{
- for(k=1,l=0;l<=valor/2;k++,l++){
- for(i=0+l;i<valor-l;i++){
- for(j=0+l;j<valor-l;j++){
- matriz[i][j]=k;
- }}
- }
- for(i=0;i<valor;i++){
- for(j=0;j<valor;j++){
- if(j!=valor-1){printf("%3d",matriz[i][j]);}
- else{printf("%3d\n",matriz[i][j]);}
- }
- }
- printf("\n");
- scanf("%d",&valor);
- }while(valor!=0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement