Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int t, dlugosc;
- string wejscie;
- int main()
- {
- cin >> t;
- for (int i = 0; i < t; i++)
- {
- cin >> wejscie;
- dlugosc = wejscie.length();
- for (int n = dlugosc-1; n > 0; n--)
- {
- if (wejscie[n]>wejscie[n-1])
- {
- wejscie[n - 1] = wejscie[n];
- wejscie[n] = NULL;
- }
- }
- cout << wejscie << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement