Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int i, j, k, sz;
- string str;
- cout<<"Enter a string : ";
- cin>>str;
- sz = str.size();
- for(i = 0; i < sz; i++)
- {
- if(str[i] >= 'a' && str[i] <= 'z')
- {
- char ch;
- ch = str[i] - 'a' + 'A';
- str[i] = ch;
- }
- }
- sort(str.begin(), str.end());
- cout<<"The expected string : "<<str<<endl;
- }
Add Comment
Please, Sign In to add comment