View Code of Problem 97

#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	while(cin >> n && n != 0)
	{
		getchar();
		string a[n],b[n];
		int num = 0;
		for(int i = 0; i < n; i++)
			getline(cin, a[i]);
		for(int i = 0; i < n; i++)
			for(int j = 0; j < n; j++)
			{
				if(a[i] + ".exe" == a[j])
					b[num++] = a[j];
			}
		sort(b, b + num);
		for(int i = 0; i < num; i++)
			cout << b[i] << endl;
	}	
	return 0;
}

Double click to view unformatted code.


Back to problem 97