summaryrefslogtreecommitdiff
path: root/Year_1/Programming_2/exercises/stringa-inversa.cc
blob: 5c377189f0742da72d2567837dec1d15bcb4fb69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include<iostream>
#include<fstream>

using namespace std;

int main() {
    ifstream in("input.txt");
    ofstream out("output.txt");

    for(int ts = 0; ts < 100; ++ts) {
        int n;
        in >> n;
        for(int i = 0; i < 3; ++i) {
            string s;
            in >> s;
            for(int j = s.length()-1; j > -1; --j) {
                out << s.at(j);
            }
            out << ' ';
        }
        out << endl;
    }

    out.close();
    in.close();
}