#include <iostream>#include <string.h>using namespace std;typedef char cuv[50];cuv v[100],aux;int i,j,n,ok;char s[256],*p;int main(){ cout << "s=";cin.getline(s,255,'\n'); p=strtok(s," "); while(p) { n++; strcpy(v[n],p); p=strtok(NULL, " "); } do{ ok=1; for(i=1;i<=n-1;i++) if(strcmp(v[i],v[i+1])>0){ strcpy(aux,v[i]); strcpy(v[i],v[i+1]); strcpy(v[i+1],aux); ok=0; } }while(ok==0); for(i=1;i<=n;i++) cout<<v[i]<<" ";}