View Code of Problem 97

#include<stdio.h>
#include<string>
#include<iostream>
#include<algorithm> 
using namespace std;

int main()
{
	int n;string s[2000],v[2000];
	while(scanf("%d",&n)!=EOF&&n!=0)
	{
		int count=0;
		for(int i=0;i<n;i++)
		{
			cin>>s[i];
		}
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				if(s[i]+".exe"==s[j])
				{
					v[count]==s[j];
					count++;
				}
			}
		}
		sort(v,v+count);
		for(int i=0;i<count;i++)
		{
			cout<<v[i]<<endl;
		}
	}
} 

Double click to view unformatted code.


Back to problem 97