Saturday, October 25, 2014

UVA-11764 (Jumping Mario) EASY

UVA-11764 (Jumping Mario) EASY

 

Screenshot_9

Screenshot_10

#include<stdio.h>
int main()
{
int N,i,c=1,T;
scanf("%d",&T);
while(0<T)
{
int HIGH =0,LOW =0,a[50];
scanf("%d",&N);
scanf("%d",&a[0]);
if(N==1)
{
printf("Case %d: %d %d\n",c,HIGH,LOW);
}
else
{
for(i=1; i<N; i++)
{
scanf("%d",&a[i]);
if(a[i-1]<a[i])
{
HIGH ++;
}
else if (a[i-1]==a[i])
{
}
else
{
LOW++;
}
}
printf("Case %d: %d %d\n",c,HIGH,LOW);
}
c++;
T--;
}
return 0;
}



UVA-11764 (Jumping Mario) EASY UVA LINK

No comments:

Post a Comment