Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- void sub(int n,int m,int a[25][25],int v[100])
- {
- int i,j,l=0;
- for(j=1;j<=m;j++)
- {
- for(i=n;i>=1;i--)
- {
- v[++l]=a[i][j];
- }
- }
- }
- int main()
- {
- int a[25][25],v[100],i,j,n,m;
- cin>>n>>m;
- for(i=1;i<=n;i++)
- for(j=1;j<=m;j++)
- cin>>a[i][j];
- sub(n,m,a,v);
- for(i=1;i<=n*m;i++)
- {
- cout<<v[i]<<" ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment