Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- int w,h,j,i,*t,**m,**b,**e;
- for(printf("Enter width, height: "),scanf("%d,%d",&w,&h),b=m=e=malloc(h*sizeof*b),i=j=0,*m=malloc(w*sizeof**e);i<h;j=0,*(++i+e)=malloc(w*sizeof**m),printf("\n"))
- while(j<w&&printf("Value at [%d,%d]: ",i,j))
- scanf("%d",*(i+b)+j++);
- e=-1+h+m;
- do{t=*e;*e=*b;*b=t;}
- while(++b<--e);
- for(i=j=0;j<h;++j,i-=w,printf("\n"))
- while(i++<w)
- printf("%d ",*(*(j+m)-1+i));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement