UVA 11942 - Lumberjack Sequencing

Problem PDF

Solution:

#include
int main()
{
    int n,c,i,a[15],up,down;
    printf("Lumberjacks:\n");
    while(scanf("%d",&n)==1)
    {
        while(n--)
        {
            for(i=0;i<10;i++)
            {
                scanf("%d",&a[i]);
            }
            up=a[0];
            down=a[1];

            if(up>down)
            {
                c=0;
                for(i=0;i<9;i++)
                {
                if(a[i]>a[i+1])
                {
                c++;
                }
                }
            }
            else if(up
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/11942/11942.cpp