#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main() { char a[1000],b[1000],c[1000],temp[1000]; gets(a); gets(b); gets(c); if(strcmp(a,b)>0){ strcpy(temp,a); strcpy(a,b); strcpy(b,temp); } if(strcmp(a,c)>0){ strcpy(temp,a); strcpy(a,c); strcpy(c,temp); } if(strcmp(b,c)>0){ strcpy(temp,b); strcpy(b,c); strcpy(c,temp); } puts(a); puts(b); puts(c); } |
Double click to view unformatted code.