Untitled
unknown
plain_text
2 months ago
303 B
3
Indexable
#include <stdio.h> #include <string.h> int main(){ int i,j; char s[101]; char temp; scanf("%s",s); int length=strlen(s); for(i=0;i<length-2;i+=2){ for(j=i+2;j<length;j+=2){ if((int)s[i]>=(int)s[j]){ temp=s[j]; s[j]=s[i]; s[i]=temp; } } } printf("%s",s); return 0; }
Editor is loading...
Leave a Comment