View Code of Problem 97

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main (){
	int n;
	while(~scanf("%d", &n)&&n){
		string str[1010], s[1010];
		int cnt = 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]){
					str[cnt++] = s[j];
				}
			}
		}
		sort(str, str+cnt);
		for(int i = 0;i < cnt;i++){
			cout<<str[i]<<endl;
		}
	}

	return 0;
}

Double click to view unformatted code.


Back to problem 97