rev='made'/> name='keywords'/> name='author'/> ANURANAN: UVa Solution 11764: Jumping Mario

Welcome Note

Hi,
I'm Anisuzzaman Babla . I am a full stack Android Application Developer. I am working with Android for more than two years. I have completed my graduation from IIT, Jahangirnagar University. I have developed a series of commercially successful apps on Android. Moreover, 10+ of my Apps are live at Google play store. .
Thank You

UVa Solution 11764: Jumping Mario


#include<stdio.h>
int main()
{
int T,N,caseno=1;
scanf("%d",&T);
while(T--)
{ int i=1,a[50],high,low;
    scanf("%d",&N);
    while(i<=N)
    {
    scanf("%d",&a[i]);
    i++;
    }
    i=1;
   high=0;low=0;
    while(i<N)
    {

        if(N==1)
         {
             low=0;high=0;
         }

        else if(a[i]<a[i+1])
        {
            high++;
        }
        else if(a[i]>a[i+1])
        {
            low++;
        }

    i++;
    }
    printf("Case %d: %d %d\n",caseno,high,low);
    caseno++;


}
return 0;
}

No comments:

Post a Comment