Advertisement
Guest User

ADŽMO

a guest
Jan 31st, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5.  
  6. #define M 4
  7. #define N 10
  8.  
  9. void fA5(char strs[M][N])
  10. {
  11. int i,j;
  12. char txt[N];
  13. for(i=0;i<M;i++){
  14. for(j=i+1;j<M;j++)
  15. if(strcmp(strs[i], strs[j])>0){
  16. strcpy(txt,strs[j]);
  17. strcpy(strs[j],strs[i]);
  18. strcpy(strs[i],txt);
  19. }
  20. printf("%s\n",strs[i]);
  21. }
  22. }
  23.  
  24. int main()
  25. {
  26. char strs[M][N]={{"amkot"},{"gowno"},{"yrtko"},{"amrd"}};
  27. fA5(strs);
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement