View Code of Problem 97

#include <string.h>

#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
    int n;
    string s[1000];
    string v[1000];
    while (cin >> n && n) {
        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];
                }
            }
        }
        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