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