For this Question: Given a sentence, your task is to print the sentence with its words present in a sorted manner.
For eg:- The sentence:- "i am a rockstar developer" will be printed as "a am developer i rockstar"The Input contains only a sentence.

Constraints:-
Total characters present in the sentence will be less than equal to 1000

Note:- The sentence will contain only lowercase English letters.Print the given sentence with the words present in the sorted order.Sample Input:-
i am a rockstar developer

Sample Output:-
a am developer i rockstar, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
int main(){
   string s;

   getline(cin,s);
   string p="";
   map<string,int> m;
   //cout<<s<<endl;
   for(int i=0;i<s.length();i++){
       if(s[i]!=' '){
       p+=s[i];}
       else{
           m[p]++;
           p="";
       }
   }
   m[p]++;
   for(auto it=m.begin();it!=m.end();it++){
       while(it->second--){
           cout<<it->first<<" ";
          
       }
   }
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?