Problem Link:http://ac.jobdu.com/problem.php?pid=1195
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<map>
#include<math.h>
#include<string.h>
#include<queue>
#include<vector>
#include<set>
#define LL long long
#define exp 1e-9
#define MAXN 1000010
using namespace std;
char str[1001][1001];
int len[1001];
int main()
{
// freopen("D:\\in.txt","r",stdin);
int maxlen,minlen,i,j;
i=0;
maxlen=0;
minlen=1010;
while(gets(str[++i]))
{
len[i]=strlen(str[i]);
maxlen=max(maxlen,len[i]);
minlen=min(minlen,len[i]);
}
for(j=1;j<i;j++)
{
if(len[j]==minlen)
{
puts(str[j]);
}
}
for(j=1;j<i;j++)
{
if(len[j]==maxlen)
{
puts(str[j]);
}
}
return 0;
}