Advertisement
rafid_shad

sort name in alphabetic order.cpp

Dec 4th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. // function to print string in sorted order
  5. void sortString(string &str)
  6. {
  7.    sort(str.begin(), str.end());
  8.    cout << str;
  9. }
  10.  
  11. // Driver program to test above function
  12. int main()
  13. {
  14.     string s ;
  15.     cin>>s;
  16.    
  17.     sortString(s);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement