Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <queue>
- #include <string>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream in ("input.txt");
- ofstream out ("output.txt");
- queue <char> tmp;
- string temp;
- string b;
- getline (in, temp);
- char a;
- for(int i = 0; i < (int) temp.size(); i++)
- {
- a = temp[i];
- if (isdigit(a))
- b += a;
- else tmp.push(a);
- }
- for (int i = 0; i < (int) b.size(); i++)
- {
- a = b[i];
- tmp.push(a);
- }
- while(!tmp.empty())
- {
- out << tmp.front();
- tmp.pop();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement