#include <stdio.h> #include <string.h> int main() { char a[3], b[3], c[3]; gets(a); gets(b); gets(c); if (strcmp(a, b) < 0) { if (strcmp(b, c) < 0) printf("%s\n%s\n%s", a, b, c); if (strcmp(a, c) > 0) printf("%s\n%s\n%s", c, a, b); else if(strcmp(b,c)>0) printf("%s\n%s\n%s", a, c, b); } else if (strcmp(a, c) > 0) { if (strcmp(b, c) > 0) printf("%s\n%s\n%s", c, b, a); else printf("%s\n%s\n%s", b, c, a); } else printf("%s\n%s\n%s", b, a, c); return 0; } |
Double click to view unformatted code.