ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1313. Some Words about Sport

Can anybody help me please? What is wrong with my code?
Posted by Александр 16 Oct 2012 14:23
#include <stdio.h>
#include<conio.h>

main()
{
      int x[100][100],a,i,j;
      scanf("%d",&a);
      for( i = 0 ; i < a ; i++ )
           for( j = 0 ; j < a ; j++ )
                scanf("%d",&x[i][j]);
      for( i = 0 ; i < a ; i++ )
           for( j = 0 ; j <= i ; j++ )
                printf("%d ",x[i-j][j]);
      for( i = a ; i < 2 * a - 1 ; i++ )
           for( j = a - 1 ; j >= i - 3 ; j-- )
                printf("%d ",x[j][i-j]);
      getch();
}
Re: Can anybody help me please? What is wrong with my code?
Posted by Dastan Yelubayev 29 Oct 2012 03:10
Maybe, in order to get full credit point from this task, you should delete the "getch()" ?
I do not want to see your sorting algorithm...
Re: Can anybody help me please? What is wrong with my code?
Posted by Killlo(UFA) 6 Jan 2014 17:13
#include <stdio.h>
#include<conio.h>

main()
{
      int x[100][100],a,i,j;
      scanf("%d",&a);
      for( i = 0 ; i < a ; i++ )
           for( j = 0 ; j < a ; j++ )
                scanf("%d",&x[i][j]);
      for( i = 0 ; i < a ; i++ )
           for( j = 0 ; j <= i ; j++ )
                printf("%d ",x[i-j][j]);
      for( i = a ; i < 2 * a - 1 ; i++ )
           for( j = a - 1 ; j >= i - (a-1) ; j-- )
                printf("%d ",x[j][i-j]);
}
Here's the correct code