TOPIC

Wrong Answer 5% C++

Arissa Yoshida asked 3 months ago

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

int main()
{
    char c;
    int x;
    cin >> x;
    getchar();
    vector<char> vet;
    for (int i = 0; i < x; i++)
    {
        while (1)
        {
            c = getchar();
            if (c == '\n')
            {
                break;
            }
            else
            {
                if (c >= 97)
                {
                    vet.push_back(c);
                }
            }
        }
        for (int j = vet.size() - 1; j >= 0; j--)
        {
            cout << vet[j];
        }
        cout << endl;
        vet.erase(vet.begin(), vet.end());
    }
}

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.