Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SirCrescator() {
- cout << "Scrie ceva: ";
- char input[300];
- cin >> input;
- int len = strlen(input);
- cout << "\nSirul de caractere introdus: " << input << endl << endl;
- for (int t = 0; t <= len - 1; t++)
- {
- for (int i = 0; i <= len - 1; i++)
- {
- if (int(input[i]) > int(input[i + 1])) {
- swap(input[i], input[i + 1]);
- }
- }
- }
- cout << "Sirul ordonat este: ";
- for (int i = 0; i <= len; i++) {
- cout << input[i] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment