Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(){
- int i,j,n;
- char str[10][100],temp[100];
- for(i=0;i<10;i++)
- gets(str[i]);
- for(i=0;i<9;i++)
- for(j=i+1;j<10;j++){
- if(strcmp(str[i],str[j])>0){
- strcpy(temp,str[i]);
- strcpy(str[i],str[j]);
- strcpy(str[j],temp);
- }
- }
- for(i=0;i<10;i++)
- puts(str[i]);
- return 0;
- }
Add Comment
Please, Sign In to add comment