Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main() {
- void swap ( char *str1, char *str2);
- int i,k,j=0;
- char temp[10][50];
- char zborovi[10][50];
- char c;
- for(i=0;i<10;i++){
- gets(zborovi[i]);
- }
- for (i = 0; i < 10; i++) {
- for (j = 0; j < 10-i; j++) {
- if (strcmp(zborovi[j], zborovi[j + 1]) > 0) {
- strcpy(temp, zborovi[j]);
- strcpy(zborovi[j], zborovi[j + 1]);
- strcpy(zborovi[j + 1], temp);
- }
- }
- }
- for(j=0;j<10;j++)
- printf("%s\n",zborovi[j]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement