View Code of Problem 78

#include<stdio.h>
#include<string.h>
#include<math.h>
void swap(char *a,char *b){
    char c[100];
    strcpy(c,a);
    strcpy(a,b);
    strcpy(b,c);
}
int main(){
    int a[100],b[100],c[100],i,j=0,min,temp,k,ge,shi,bai,qian;
    scanf("%s",a);
    scanf("%s",b);
    scanf("%s",c);
    if(strcmp(a,b)>0)swap(a,b);
    if(strcmp(a,c)>0)swap(a,c);
    if(strcmp(b,c)>0)swap(b,c);
    printf("%s\n",a);
    printf("%s\n",b);
    printf("%s\n",c);
    return 0;
}

Double click to view unformatted code.


Back to problem 78