Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- #define M 4
- #define N 10
- void fA5(char strs[M][N])
- {
- int i,j;
- char txt[N];
- for(i=0;i<M;i++){
- for(j=i+1;j<M;j++)
- if(strcmp(strs[i], strs[j])>0){
- strcpy(txt,strs[j]);
- strcpy(strs[j],strs[i]);
- strcpy(strs[i],txt);
- }
- printf("%s\n",strs[i]);
- }
- }
- int main()
- {
- char strs[M][N]={{"amkot"},{"gowno"},{"yrtko"},{"amrd"}};
- fA5(strs);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement