Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int a[110][110],t,i,j,c;
- scanf("%d",&t);
- for(i=1;i<=t;i++){
- for(j=1;j<=t;j++)
- scanf("%d",&a[i][j]);
- }
- for(c=1;c<=t;c++){
- i=c;
- j=1;
- while(1){
- printf("%d ",a[i][j]);
- i--;
- j++;
- if(i<1)
- break;
- }
- }
- for(c=1;c<t;c++){
- i=t;
- j=c+1;
- while(1){
- printf("%d ",a[i][j]);
- i--;
- j++;
- if(j>t)
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement