#include
#include
#include
int main ()
{
int a[5][5],r,c,n,m,y,x;
y=50;
printf("Seguimiento matriz 3 X 3");
printf("\n");
printf("\n");
printf("Escribe el numero: ",n);
scanf("%i",&n);
printf("\n");
if(n<=50){ for(r=0;r<=4;r++){ for(c=0;c<=9;c++){ a[r][c]=n; n=n+1; if(n>=51){
a[r][c]=y;
y=y-1;
}
printf(" %i",a[r][c]);
}
printf(" \n");
printf(" \n");
}}
if(n>=50){
for(r=0;r<=4;r++){
for(c=0;c<=9;c++){
a[r][c]=n;
n=n-1;
if(n<=50){
a[r][c]=y;
y=y+1;
}
printf(" %i",a[r][c]);
}
printf(" \n");
printf(" \n");
}}
system("PAUSE");
return 0;
}