Yurttas/PL/OOL/Cplusplus/F/02/04/03/13/00/reverse 01.cpp

 1/*
 2   Copyright(C) 1998
 3   All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4
 5   Permission to use, copy, modify, and distribute this
 6   software and its documentation for EDUCATIONAL purposes
 7   and without fee is hereby granted provided that this
 8   copyright notice appears in all copies.
 9 
10   date   : January 1, 1998.
11   authorĀ : Salih Yurttas.
12
13   reverse_01.cpp
14*/
15
16
17#include <iostream>
18
19#include <vector>
20#include <string>
21
22#include <algorithm>
23
24using namespace std;
25
26int main(int argc, char *argv[]) { 
27
28  string d[] = {"AAGTCTAGTACCC",
29                "CAGAGTAGGACCT",
30                "AAGAGTAGGACCG",
31                "AAGACTAGGACCA",
32                "CAGAAGTTGTCGT",
33                "GCCTTGTGGACCC"};
34
35  vector<string> v(d, d+6);
36
37  int n = v.size();
38  for(int i=0; i<n; ++i)
39    cout << v.at(i) << endl;
40
41  cout << endl;
42
43  for(int i=0; i<n; ++i)
44    reverse(v.at(i).begin(), v.at(i).end());
45
46  for(int i=0; i<n; ++i)
47    cout << v.at(i) << endl;
48
49}