PAT L2-017 人以群分(25 分)

STL sort排序+判断的水题

题目链接

//排序 PAT L2-017 
#include 
#include  
using namespace std;
int a[100005];
int main(void)
{
	int n;
	scanf("%d",&n); 
	for(int i=0;itemp2)
		{
			printf("Outgoing #: %d\n",n/2+1);
			printf("Introverted #: %d\n",n/2);
			printf("Diff = %d\n",temp1);		
		}	
		else
		{
			printf("Outgoing #: %d\n",n/2);
			printf("Introverted #: %d\n",n/2+1);
			printf("Diff = %d\n",temp2);
		}	
		
	}
} 

 

你可能感兴趣的:(前期要刷的水题,STL)