155A: I_love_%username%

Problem Link

<Source Code>

#include <stdio.h>

int main(void) {
	long long n,t,i,min,max,co=0,c=0;
	scanf("%lld",&n);
	long long a[n];
	for(i=1;i<=n;i++)
	scanf("%lld",&a[i]);
	max=a[1];min=a[1];
	for(i=2;i<=n;i++)
	{
		if(a[i]>max)
		{max=a[i];
		c++;
		}
else if(a[i]<min)
{min=a[i];
co++;}
	}
	printf("%lld\n",co+c);
}
Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s