Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
string-Orderly words
//g++ 7.4.0 #include <iostream> #include <cstring> using namespace std; int main() { char a[256], b[100], v[150][256], *p; int n=0, i,j; cin.get(a,255); p=strtok(a," ."); while(p!=0) { n++; strcpy(v[n], p); p=strtok(NULL," ."); } for(i=1;i<=n;i++) cout<<v[i]<<' '; cout<<endl; for(i=1;i<n;i++) for(j=i+1;j<=n;j++) if(strcmp(v[i],v[j])>0) { strcpy(b,v[i]); strcpy(v[i],v[j]); strcpy(v[j],b); } for(i=1;i<=n;i++) cout<<v[i]<<' '; return 0; }
run
|
edit
|
history
|
help
0
Extended Euclidean Algorithm
half diamond or pyramid
char strcpy
Iviewb
ExtremeValues
LIS_NEW
TraceMarrix
The Menu
QuickSort
Bad code