Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- int main() {
- // ios_base::sync_with_stdio(false);
- // cin.tie(0);
- ifstream in("input.txt");
- while (in.peek() != EOF) {
- string a;
- string b;
- in >> a >> b;
- if (b.empty()) {
- cout << a << ' ';
- } else {
- cout << b << ' ' << a << ' ';
- }
- }
- in.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement