Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- ifstream in("input.txt");
- ofstream out("output.txt");
- int main() {
- string f;
- getline(in, f);
- int p = 1;
- string s;
- while (getline(in, s)) {
- if (s == "|.." && p == 1) {
- getline(in, s);
- out << ">";
- p = p + 1;
- continue;
- }
- else if (s == "|.." && p == 2) {
- getline(in, s);
- out << "<";
- p = p - 1;
- continue;
- }
- else if (s == "..|" && p == 0) {
- getline(in, s);
- out << ">";
- p = p + 1;
- continue;
- }
- else if (s == "..|" && p == 1) {
- getline(in, s);
- out << "<";
- p = p - 1;
- continue;
- }
- else if (s[p] == 'o'){
- getline(in, s);
- out << "^";
- continue;
- }
- else if (s[p] == '-') {
- getline(in, s);
- out << "v";
- }
- else if (s[p] == '.') {
- getline(in, s);
- out << "_";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement